diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-10-31 04:23:06 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-10-31 04:23:06 +0000 |
commit | 64396f7e8e3914d66d4b5efb9bfd80c8cd7a72fd (patch) | |
tree | 70a47dc3100da9328a1cd40bb5ac49e37c40a756 /bin/chkcontents | |
parent | add4ae8be75bd027f51977e601c9af8f1ddb27ee (diff) | |
download | portage-64396f7e8e3914d66d4b5efb9bfd80c8cd7a72fd.tar.gz portage-64396f7e8e3914d66d4b5efb9bfd80c8cd7a72fd.tar.bz2 portage-64396f7e8e3914d66d4b5efb9bfd80c8cd7a72fd.zip |
Rely on PYTHONPATH instead of PORTAGE_PYM_PATH for locating portage's python modules, then fall back to an explicit sys.path insertion if an ImportError occurs.
svn path=/main/trunk/; revision=4884
Diffstat (limited to 'bin/chkcontents')
-rwxr-xr-x | bin/chkcontents | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/chkcontents b/bin/chkcontents index 4523b6306..aae45c6bc 100755 --- a/bin/chkcontents +++ b/bin/chkcontents @@ -9,8 +9,11 @@ # the right files). import string, os.path, os, sys -sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym")) -import portage +try: + import portage +except ImportError: + sys.path.insert(0, "/usr/lib/portage/pym") + import portage def CONTENTScheck(path): try: |