diff options
author | Anatoly Techtonik <techtonik@gmail.com> | 2011-04-14 11:38:02 (GMT) |
---|---|---|
committer | Anatoly Techtonik <techtonik@gmail.com> | 2011-04-14 11:38:02 (GMT) |
commit | e48ee0e711ca487893d34c9a3449a009135f28cc (patch) | |
tree | b6f1ad3b3ae784484a6718ec214a4164f611fc35 /src/script/sconsign.py | |
parent | a7e911974027bb05dbf3796b7e7c53f2b463cd43 (diff) | |
download | SCons-e48ee0e711ca487893d34c9a3449a009135f28cc.zip SCons-e48ee0e711ca487893d34c9a3449a009135f28cc.tar.gz SCons-e48ee0e711ca487893d34c9a3449a009135f28cc.tar.bz2 |
fix issue #2051 - broken installation with easy_install on Windows
the fix was only committed for unix previously
Diffstat (limited to 'src/script/sconsign.py')
-rw-r--r-- | src/script/sconsign.py | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/script/sconsign.py b/src/script/sconsign.py index 4c726da..e5e9d4f 100644 --- a/src/script/sconsign.py +++ b/src/script/sconsign.py @@ -37,7 +37,6 @@ __developer__ = "__DEVELOPER__" import os import sys -import time ############################################################################## # BEGIN STANDARD SCons SCRIPT HEADER @@ -75,8 +74,22 @@ libs.append(os.path.abspath(local)) scons_version = 'scons-%s' % __version__ +# preferred order of scons lookup paths prefs = [] +try: + import pkg_resources +except ImportError: + pass +else: + # when running from an egg add the egg's directory + try: + d = pkg_resources.get_distribution('scons') + except pkg_resources.DistributionNotFound: + pass + else: + prefs.append(d.location) + if sys.platform == 'win32': # sys.prefix is (likely) C:\Python*; # check only C:\Python*. @@ -145,19 +158,6 @@ else: # Check /usr/libfoo/scons*. prefs.append(libpath) - try: - import pkg_resources - except ImportError: - pass - else: - # when running from an egg add the egg's directory - try: - d = pkg_resources.get_distribution('scons') - except pkg_resources.DistributionNotFound: - pass - else: - prefs.append(d.location) - # Look first for 'scons-__version__' in all of our preference libs, # then for 'scons'. libs.extend([os.path.join(x, scons_version) for x in prefs]) @@ -172,6 +172,7 @@ sys.path = libs + sys.path import SCons.compat # so pickle will import cPickle instead import whichdb +import time import pickle import imp |