[Zope3-checkins] SVN: zope.testing/trunk/src/zope/testing/testrunner.py resume_tests(): On Windows, this could try to do

Tim Peters tim.one at comcast.net
Mon Oct 3 17:06:28 EDT 2005


Log message for revision 38729:
  resume_tests():  On Windows, this could try to do
  
      args.insert(1, '-O')
  
  after `args` had been changed from a list to a string.
  Blew up then.  Swapped the order of the code so that
  list operations are all done while `args` is still a
  list.
  
  The bad news:  the tests run on Windows under Python
  2.3.5 using -O then, but _sometimes_ Python itself dies
  with a segfault.  No clues yet.
  
  Have not seen that happen under 2.4.2 with -O.
  

Changed:
  U   zope.testing/trunk/src/zope/testing/testrunner.py

-=-
Modified: zope.testing/trunk/src/zope/testing/testrunner.py
===================================================================
--- zope.testing/trunk/src/zope/testing/testrunner.py	2005-10-03 20:50:30 UTC (rev 38728)
+++ zope.testing/trunk/src/zope/testing/testrunner.py	2005-10-03 21:06:28 UTC (rev 38729)
@@ -421,17 +421,17 @@
 
     args.extend(options.original_testrunner_args[1:])
 
+    # this is because of a bug in Python (http://www.python.org/sf/900092)
+    if (hotshot is not None and options.profile
+    and sys.version_info[:3] <= (2,4,1)):
+        args.insert(1, '-O')
+
     if sys.platform.startswith('win'):
         args = args[0] + ' ' + ' '.join([
             ('"' + a.replace('\\', '\\\\').replace('"', '\\"') + '"')
             for a in args[1:]
             ])
 
-    # this is because of a bug in Python (http://www.python.org/sf/900092)
-    if (hotshot is not None and options.profile
-    and sys.version_info[:3] <= (2,4,1)):
-        args.insert(1, '-O')
-
     subin, subout, suberr = os.popen3(args)
     for l in subout:
         sys.stdout.write(l)



More information about the Zope3-Checkins mailing list