aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorBrian Harring <ferringb@gmail.com>2011-05-24 19:30:08 -0700
committerBrian Harring <ferringb@gmail.com>2011-05-24 19:30:08 -0700
commitbae3bb8abafe1eff8b844508efc579777ac7e457 (patch)
treefe122efd68ae9a852e6cafef5a384c6e5d450790 /bin
parentmark 0.6.1 (diff)
downloadpkgcore-bae3bb8abafe1eff8b844508efc579777ac7e457.tar.gz
pkgcore-bae3bb8abafe1eff8b844508efc579777ac7e457.tar.bz2
pkgcore-bae3bb8abafe1eff8b844508efc579777ac7e457.zip
expand the failed imports error reporting for the wrappers
Add python version, and match pwrapper (used for development) to the production code.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/pwrapper13
-rwxr-xr-xbin/pwrapper_installed3
2 files changed, 13 insertions, 3 deletions
diff --git a/bin/pwrapper b/bin/pwrapper
index 7f649c143..9139cfeb7 100755
--- a/bin/pwrapper
+++ b/bin/pwrapper
@@ -12,8 +12,17 @@ import sys
sys.path.insert(0, osp.dirname(osp.dirname(osp.abspath(__file__))))
-from pkgcore.util import commandline
-from snakeoil import modules
+try:
+ from snakeoil import modules
+ from pkgcore.util import commandline
+except ImportError:
+ sys.stderr.write('Cannot import either snakeoil.modules or pkgcore.util.commandline!\n')
+ sys.stderr.write('Verify it is properly installed and/or ' \
+ 'PYTHONPATH is set correctly for python version %s\n' %
+ (".".join(map(str, sys.version_info[:3])),))
+ if '--debug' in sys.argv:
+ raise
+ sys.exit(1)
if __name__ == '__main__':
name = osp.basename(sys.argv[0]).replace("-", "_")
diff --git a/bin/pwrapper_installed b/bin/pwrapper_installed
index db019fa76..2aea117df 100755
--- a/bin/pwrapper_installed
+++ b/bin/pwrapper_installed
@@ -12,7 +12,8 @@ if __name__ == '__main__':
except ImportError:
sys.stderr.write('Cannot import pkgcore!\n')
sys.stderr.write('Verify it is properly installed and/or ' \
- 'PYTHONPATH is set correctly.\n')
+ 'PYTHONPATH is set correctly for python %s.\n' %
+ (".".join(map(str, sys.version_info[:3])),))
if '--debug' in sys.argv:
raise
sys.stderr.write('Add --debug to the commandline for a traceback.\n')