From 64396f7e8e3914d66d4b5efb9bfd80c8cd7a72fd Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 31 Oct 2006 04:23:06 +0000 Subject: 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 --- bin/fix-db.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'bin/fix-db.py') diff --git a/bin/fix-db.py b/bin/fix-db.py index fef1a4d44..e8bbad2ca 100755 --- a/bin/fix-db.py +++ b/bin/fix-db.py @@ -4,7 +4,12 @@ # $Id$ import os,sys,re -sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym")) + +try: + import portage +except ImportError: + sys.path.insert(0, "/usr/lib/portage/pym") + import portage from stat import * from output import * -- cgit v1.2.3-1-g7c22