anatoly techtonik avatar anatoly techtonik committed bb43bc7

fix issue #2051 - broken installation with easy_install on Windows

the fix was only committed for unix previously

Comments (0)

Files changed (2)

src/script/scons.py

 # 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__"
 
 __developer__ = "__DEVELOPER__"
 
 import os
-import os.path
 import sys
 
 ##############################################################################
 
 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*.
         # 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])

src/script/sconsign.py

 
 import os
 import sys
-import time
 
 ##############################################################################
 # BEGIN STANDARD SCons SCRIPT HEADER
 
 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*.
         # 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])
 import SCons.compat   # so pickle will import cPickle instead
 
 import whichdb
+import time
 import pickle
 import imp
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.