[Checkins] SVN: zc.buildout/branches/gary-support-system-python/bootstrap/bootstrap.py another fix: if pkg_resources was installed but not setuptools, this would fall over. no more. Tests for this change and the previous one will need to come later.

Gary Poster gary.poster at canonical.com
Thu Jul 16 16:26:30 EDT 2009


Log message for revision 101951:
  another fix: if pkg_resources was installed but not setuptools, this would fall over.  no more.  Tests for this change and the previous one will need to come later.

Changed:
  U   zc.buildout/branches/gary-support-system-python/bootstrap/bootstrap.py

-=-
Modified: zc.buildout/branches/gary-support-system-python/bootstrap/bootstrap.py
===================================================================
--- zc.buildout/branches/gary-support-system-python/bootstrap/bootstrap.py	2009-07-16 19:30:41 UTC (rev 101950)
+++ zc.buildout/branches/gary-support-system-python/bootstrap/bootstrap.py	2009-07-16 20:26:30 UTC (rev 101951)
@@ -107,6 +107,7 @@
     requirement += '==' + configuration['--version']
 
 try:
+    import setuptools # A flag.  Sometimes pkg_resources is installed alone.
     import pkg_resources
 except ImportError:
     ez = {}
@@ -115,8 +116,12 @@
     if configuration['--download-base']:
         setuptools_args['download_base'] = configuration['--download-base']
     ez['use_setuptools'](**setuptools_args)
-
     import pkg_resources
+    # This does not (always?) update the default working set.  We will
+    # do it.
+    for path in sys.path:
+        if path not in pkg_resources.working_set.entries:
+            pkg_resources.working_set.add_entry(path)
 
 if sys.platform == 'win32':
     def quote(c):



More information about the Checkins mailing list