summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_sys.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2009-10-27 19:25:57 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2009-10-27 19:25:57 (GMT)
commit836f0e217e7528223e777fe2472551febd643d26 (patch)
treee3e19eeac201850890f2a84c9bb52ca4af726199 /Lib/test/test_sys.py
parent45ebeb8f24710cbc50c77806893df1a2e7593762 (diff)
downloadcpython-836f0e217e7528223e777fe2472551febd643d26.zip
cpython-836f0e217e7528223e777fe2472551febd643d26.tar.gz
cpython-836f0e217e7528223e777fe2472551febd643d26.tar.bz2
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. ........
Diffstat (limited to 'Lib/test/test_sys.py')
-rw-r--r--Lib/test/test_sys.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
index 699d5a6..599f09b 100644
--- a/Lib/test/test_sys.py
+++ b/Lib/test/test_sys.py
@@ -16,6 +16,7 @@ class SysModuleTest(unittest.TestCase):
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 @@ class SysModuleTest(unittest.TestCase):
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 @@ class SysModuleTest(unittest.TestCase):
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'?')