]> granicus.if.org Git - python/commitdiff
Followup to r75965: replace the test_uuid-specific patch with a generic fix
authorAntoine Pitrou <solipsis@pitrou.net>
Fri, 30 Oct 2009 18:30:35 +0000 (18:30 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Fri, 30 Oct 2009 18:30:35 +0000 (18:30 +0000)
(other tests may have the same problem).

Lib/test/regrtest.py
Lib/test/test_uuid.py

index 2b8a6a7a940596f7ed031fd396a529baa4447104..75a74fa50f27ae6a465960e5e219c67596616804 100755 (executable)
@@ -996,6 +996,12 @@ def dash_R_cleanup(fs, ps, pic, abcs):
             obj._abc_cache.clear()
             obj._abc_negative_cache.clear()
 
+    # Flush standard output, so that buffered data is sent to the OS and
+    # associated Python objects are reclaimed.
+    for stream in (sys.stdout, sys.stderr, sys.__stdout__, sys.__stderr__):
+        if stream is not None:
+            stream.flush()
+
     # Clear assorted module caches.
     _path_created.clear()
     re.purge()
index b4dd459720d3f944726d771eaf3959cb55a436a8..b749abce39d672c86253d43b2f0228f9fa02bfee 100644 (file)
@@ -314,7 +314,6 @@ class TestUUID(TestCase):
         import sys
         print("""    WARNING: uuid._ifconfig_getnode is unreliable on many platforms.
         It is disabled until the code and/or test can be fixed properly.""", file=sys.__stdout__)
-        sys.__stdout__.flush()
         return
 
         import os
@@ -343,7 +342,6 @@ class TestUUID(TestCase):
         import sys
         print("""    WARNING: uuid._unixdll_getnode is unreliable on many platforms.
         It is disabled until the code and/or test can be fixed properly.""", file=sys.__stdout__)
-        sys.__stdout__.flush()
         return
 
         import os
@@ -359,7 +357,6 @@ class TestUUID(TestCase):
         import sys
         print("""    WARNING: uuid.getnode is unreliable on many platforms.
         It is disabled until the code and/or test can be fixed properly.""", file=sys.__stdout__)
-        sys.__stdout__.flush()
         return
 
         node1 = uuid.getnode()