[Checkins] SVN: zc.buildout/branches/gary-7/ with these changes, I can build zc.buildout and run its tests successfully with my system Python. To make it fully robust, zc.recipe.test probably would need to use sitepackage_safe_scripts, but this works for now.

Gary Poster gary.poster at canonical.com
Wed Feb 24 17:48:43 EST 2010


Log message for revision 109424:
  with these changes, I can build zc.buildout and run its tests successfully with my system Python.  To make it fully robust, zc.recipe.test probably would need to use sitepackage_safe_scripts, but this works for now.

Changed:
  A   zc.buildout/branches/gary-7/
  U   zc.buildout/branches/gary-7/bootstrap/bootstrap.py
  U   zc.buildout/branches/gary-7/dev.py

-=-
Modified: zc.buildout/branches/gary-7/bootstrap/bootstrap.py
===================================================================
--- zc.buildout/branches/gary-6/bootstrap/bootstrap.py	2010-02-24 21:40:07 UTC (rev 109421)
+++ zc.buildout/branches/gary-7/bootstrap/bootstrap.py	2010-02-24 22:48:43 UTC (rev 109424)
@@ -99,14 +99,14 @@
 
 args = args + ['bootstrap']
 
-to_reload = False
 
 try:
-    import setuptools # A flag.  Sometimes pkg_resources is installed alone.
+    to_reload = False
     import pkg_resources
+    to_reload = True
     if not hasattr(pkg_resources, '_distribute'):
-        to_reload = True
         raise ImportError
+    import setuptools # A flag.  Sometimes pkg_resources is installed alone.
 except ImportError:
     ez_code = urllib2.urlopen(
         options.setup_source).read().replace('\r\n', '\n')
@@ -118,7 +118,6 @@
     if options.use_distribute:
         setup_args['no_fake'] = True
     ez['use_setuptools'](**setup_args)
-
     if to_reload:
         reload(pkg_resources)
     else:

Modified: zc.buildout/branches/gary-7/dev.py
===================================================================
--- zc.buildout/branches/gary-6/dev.py	2010-02-24 21:40:07 UTC (rev 109421)
+++ zc.buildout/branches/gary-7/dev.py	2010-02-24 22:48:43 UTC (rev 109424)
@@ -31,7 +31,10 @@
     shutil.rmtree('build')
 
 try:
+    to_reload = False
     import pkg_resources
+    to_reload = True
+    import setuptools # A flag.  Sometimes pkg_resources is installed alone.
 except ImportError:
     ez = {}
     exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
@@ -39,6 +42,8 @@
     ez['use_setuptools'](to_dir='eggs', download_delay=0)
 
     import pkg_resources
+    if to_reload:
+        reload(pkg_resources)
 
 env = os.environ.copy() # Windows needs yet-to-be-determined values from this.
 env['PYTHONPATH'] = os.path.dirname(pkg_resources.__file__)



More information about the checkins mailing list