[Checkins] SVN: zc.buildout/branches/gary-8/src/zc/buildout/buildout.py fix intermittent test failure in update.txt

Gary Poster gary.poster at canonical.com
Fri Mar 19 11:32:03 EDT 2010


Log message for revision 110066:
  fix intermittent test failure in update.txt

Changed:
  U   zc.buildout/branches/gary-8/src/zc/buildout/buildout.py

-=-
Modified: zc.buildout/branches/gary-8/src/zc/buildout/buildout.py
===================================================================
--- zc.buildout/branches/gary-8/src/zc/buildout/buildout.py	2010-03-19 11:13:15 UTC (rev 110065)
+++ zc.buildout/branches/gary-8/src/zc/buildout/buildout.py	2010-03-19 15:32:03 UTC (rev 110066)
@@ -889,8 +889,11 @@
         # the new dist is different, so we've upgraded.
         # Update the scripts and return True
         partsdir = os.path.join(options['parts-directory'], 'buildout')
-        if not os.path.exists(partsdir):
-            os.mkdir(partsdir)
+        if os.path.exists(partsdir):
+            # This is primarily for unit tests, in which .py files change too
+            # fast for Python to know to regenerate the .pyc/.pyo files.
+            shutil.rmtree(partsdir)
+        os.mkdir(partsdir)
         zc.buildout.easy_install.sitepackage_safe_scripts(
             options['bin-directory'], ws, sys.executable, partsdir,
             reqs=['zc.buildout'])



More information about the checkins mailing list