[Checkins] SVN: bluebream/branches/ccomb-remove-bbkit/ backport a fix from latest bootstrap.py

Christophe Combelles ccomb at free.fr
Sat Jul 10 04:54:49 EDT 2010


Log message for revision 114467:
  backport a fix from latest bootstrap.py
  

Changed:
  U   bluebream/branches/ccomb-remove-bbkit/bootstrap.py
  U   bluebream/branches/ccomb-remove-bbkit/src/bluebream/bluebream_base/project_template/bootstrap.py

-=-
Modified: bluebream/branches/ccomb-remove-bbkit/bootstrap.py
===================================================================
--- bluebream/branches/ccomb-remove-bbkit/bootstrap.py	2010-07-10 08:45:14 UTC (rev 114466)
+++ bluebream/branches/ccomb-remove-bbkit/bootstrap.py	2010-07-10 08:54:48 UTC (rev 114467)
@@ -16,8 +16,6 @@
 Simply run this script in a directory containing a buildout.cfg.
 The script accepts buildout command-line options, so you can
 use the -c option to specify an alternate configuration file.
-
-$Id: bootstrap.py 105417 2009-11-01 15:15:20Z tarek $
 """
 
 import os, shutil, sys, tempfile, urllib2
@@ -56,11 +54,10 @@
 USE_DISTRIBUTE = options.distribute
 args = args + ['bootstrap']
 
-to_reload = False
 try:
     import pkg_resources
+    import setuptools
     if not hasattr(pkg_resources, '_distribute'):
-        to_reload = True
         raise ImportError
 except ImportError:
     ez = {}
@@ -73,10 +70,8 @@
                              ).read() in ez
         ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
 
-    if to_reload:
-        reload(pkg_resources)
-    else:
-        import pkg_resources
+    reload(sys.modules['pkg_resources'])
+    import pkg_resources
 
 if sys.platform == 'win32':
     def quote(c):

Modified: bluebream/branches/ccomb-remove-bbkit/src/bluebream/bluebream_base/project_template/bootstrap.py
===================================================================
--- bluebream/branches/ccomb-remove-bbkit/src/bluebream/bluebream_base/project_template/bootstrap.py	2010-07-10 08:45:14 UTC (rev 114466)
+++ bluebream/branches/ccomb-remove-bbkit/src/bluebream/bluebream_base/project_template/bootstrap.py	2010-07-10 08:54:48 UTC (rev 114467)
@@ -16,8 +16,6 @@
 Simply run this script in a directory containing a buildout.cfg.
 The script accepts buildout command-line options, so you can
 use the -c option to specify an alternate configuration file.
-
-$Id: bootstrap.py 105417 2009-11-01 15:15:20Z tarek $
 """
 
 import os, shutil, sys, tempfile, urllib2
@@ -56,11 +54,10 @@
 USE_DISTRIBUTE = options.distribute
 args = args + ['bootstrap']
 
-to_reload = False
 try:
     import pkg_resources
+    import setuptools
     if not hasattr(pkg_resources, '_distribute'):
-        to_reload = True
         raise ImportError
 except ImportError:
     ez = {}
@@ -73,10 +70,8 @@
                              ).read() in ez
         ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
 
-    if to_reload:
-        reload(pkg_resources)
-    else:
-        import pkg_resources
+    reload(sys.modules['pkg_resources'])
+    import pkg_resources
 
 if sys.platform == 'win32':
     def quote(c):



More information about the checkins mailing list