summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnatoly Techtonik <techtonik@gmail.com>2011-04-14 11:38:02 (GMT)
committerAnatoly Techtonik <techtonik@gmail.com>2011-04-14 11:38:02 (GMT)
commite48ee0e711ca487893d34c9a3449a009135f28cc (patch)
treeb6f1ad3b3ae784484a6718ec214a4164f611fc35
parenta7e911974027bb05dbf3796b7e7c53f2b463cd43 (diff)
downloadSCons-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
-rw-r--r--src/script/scons.py29
-rw-r--r--src/script/sconsign.py29
2 files changed, 29 insertions, 29 deletions
diff --git a/src/script/scons.py b/src/script/scons.py
index 0e2cd63..86d2562 100644
--- a/src/script/scons.py
+++ b/src/script/scons.py
@@ -22,7 +22,6 @@
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
@@ -37,7 +36,6 @@ __date__ = "__DATE__"
__developer__ = "__DEVELOPER__"
import os
-import os.path
import sys
##############################################################################
@@ -90,8 +88,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*.
@@ -160,19 +172,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])
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