[Zope3-checkins] SVN: Zope3/trunk/releases/Zope/test.py Fixed issue 716 'make check throws exception' by porting Jim's fix from branches/3.3

Michael Howitz mh+zope at gocept.com
Fri Sep 29 04:25:35 EDT 2006


Log message for revision 70441:
  Fixed issue 716 'make check throws exception' by porting Jim's fix from branches/3.3

Changed:
  U   Zope3/trunk/releases/Zope/test.py

-=-
Modified: Zope3/trunk/releases/Zope/test.py
===================================================================
--- Zope3/trunk/releases/Zope/test.py	2006-09-29 08:24:00 UTC (rev 70440)
+++ Zope3/trunk/releases/Zope/test.py	2006-09-29 08:25:34 UTC (rev 70441)
@@ -42,8 +42,19 @@
                '--unit', '--verbose']
 result = testrunner.run(defaultargs)
 
+# Note, the logging system has bugs, fixed in Python 2.5 that cause spurious
+# errors on exit.  We'll execute a fairly voilent suicide to try to avoid
+# these.  Given that this is just a test runner, this should be OK.
+
 # Avoid spurious error during exit. Some thing is trying to log
 # something after the files used by the logger have been closed.
 logging.disable(999999999)
 
-sys.exit(result)
+# Because we're about to use os._exit, we flush output so we don't miss any.
+sys.stdout.flush()
+sys.stderr.flush()
+os._exit(result)
+
+# TODO according to the comment above:
+#      with python 2.5 the above 3 lines should be again:
+# sys.exit(result)



More information about the Zope3-Checkins mailing list