aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTim Harder <radhermit@gmail.com>2015-02-06 15:10:45 -0800
committerTim Harder <radhermit@gmail.com>2015-02-06 15:14:46 -0800
commitb16a5d62ee2dac8b4e9ad7248d243a575884f2da (patch)
tree8e8b4344907fcac111bd4a3e25bf5211c5f5fb1f /bin
parentdocs: pebuild now handles ebuild path arguments (diff)
downloadpkgcore-b16a5d62ee2dac8b4e9ad7248d243a575884f2da.tar.gz
pkgcore-b16a5d62ee2dac8b4e9ad7248d243a575884f2da.tar.bz2
pkgcore-b16a5d62ee2dac8b4e9ad7248d243a575884f2da.zip
use importlib.import_module instead of snakeoil.modules.load_module
Diffstat (limited to 'bin')
-rwxr-xr-xbin/pwrapper6
-rwxr-xr-xbin/pwrapper_installed6
2 files changed, 6 insertions, 6 deletions
diff --git a/bin/pwrapper b/bin/pwrapper
index 1917467bd..c7532e8dc 100755
--- a/bin/pwrapper
+++ b/bin/pwrapper
@@ -7,6 +7,7 @@ checkout or unpacked tarball. It adds the parent of that "bin" dir to
sys.path unconditionally.
"""
+from importlib import import_module
import os
import os.path as osp
import sys
@@ -15,7 +16,6 @@ sys.path.insert(1, osp.dirname(osp.dirname(osp.abspath(__file__))))
if __name__ == '__main__':
try:
- from snakeoil import modules
from pkgcore.util import commandline
except ImportError:
sys.stderr.write('Cannot import either snakeoil or pkgcore!\n')
@@ -30,8 +30,8 @@ if __name__ == '__main__':
os.environ["PKGCORE_SCRIPT_PATH"] = osp.dirname(osp.abspath(__file__))
name = osp.basename(sys.argv[0]).replace("-", "_")
try:
- script = modules.load_module('pkgcore.scripts.%s' % (name,))
- except modules.FailedImport:
+ script = import_module('pkgcore.scripts.%s' % (name,))
+ except ImportError:
sys.stderr.write('Cannot load script %s.\n' % (name,))
if '--debug' in sys.argv:
raise
diff --git a/bin/pwrapper_installed b/bin/pwrapper_installed
index 5056e1fcf..89318c3ab 100755
--- a/bin/pwrapper_installed
+++ b/bin/pwrapper_installed
@@ -2,12 +2,12 @@
"""Wrapper script that runs a pkgcore script from sys.path."""
+from importlib import import_module
import os.path as osp
import sys
if __name__ == '__main__':
try:
- from snakeoil import modules
from pkgcore.util import commandline
except ImportError:
sys.stderr.write('Cannot import either snakeoil or pkgcore!\n')
@@ -21,8 +21,8 @@ if __name__ == '__main__':
name = osp.basename(sys.argv[0]).replace("-", "_")
try:
- script = modules.load_module('pkgcore.scripts.%s' % (name,))
- except modules.FailedImport:
+ script = import_module('pkgcore.scripts.%s' % (name,))
+ except ImportError:
sys.stderr.write('Cannot load script %s.\n' % (name,))
if '--debug' in sys.argv:
raise