[Python-checkins] r75843 - in python/branches/py3k: Lib/test/test_sys.py

antoine.pitrou python-checkins at python.org
Tue Oct 27 20:25:58 CET 2009


Author: antoine.pitrou
Date: Tue Oct 27 20:25:57 2009
New Revision: 75843

Log:
Merged revisions 75842 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r75842 | antoine.pitrou | 2009-10-27 20:23:56 +0100 (mar., 27 oct. 2009) | 3 lines
  
  Fix transient refleak in test_sys.
........


Modified:
   python/branches/py3k/   (props changed)
   python/branches/py3k/Lib/test/test_sys.py

Modified: python/branches/py3k/Lib/test/test_sys.py
==============================================================================
--- python/branches/py3k/Lib/test/test_sys.py	(original)
+++ python/branches/py3k/Lib/test/test_sys.py	Tue Oct 27 20:25:57 2009
@@ -16,6 +16,7 @@
         sys.stdout = self.orig_stdout
         sys.stderr = self.orig_stderr
         sys.displayhook = self.orig_displayhook
+        test.support.reap_children()
 
     def test_original_displayhook(self):
         import builtins
@@ -261,6 +262,7 @@
             self.current_frames_without_threads()
 
     # Test sys._current_frames() in a WITH_THREADS build.
+    @test.support.reap_threads
     def current_frames_with_threads(self):
         import threading, _thread
         import traceback
@@ -424,13 +426,13 @@
         env["PYTHONIOENCODING"] = "cp424"
         p = subprocess.Popen([sys.executable, "-c", 'print(chr(0xa2))'],
                              stdout = subprocess.PIPE, env=env)
-        out = p.stdout.read()
+        out = p.communicate()[0].strip()
         self.assertEqual(out, "\xa2\n".encode("cp424"))
 
         env["PYTHONIOENCODING"] = "ascii:replace"
         p = subprocess.Popen([sys.executable, "-c", 'print(chr(0xa2))'],
                              stdout = subprocess.PIPE, env=env)
-        out = p.stdout.read().strip()
+        out = p.communicate()[0].strip()
         self.assertEqual(out, b'?')
 
 


More information about the Python-checkins mailing list