summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2009-10-27 19:23:56 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2009-10-27 19:23:56 (GMT)
commite171edc832a7559e8b198700014f2ac8e69437bc (patch)
treeee214fb276f6c7583c0e9ebf48bc29c1bec3acde /Lib/test
parent85bd5879b21c8dde3938c69945626bc405b5d4d3 (diff)
downloadcpython-e171edc832a7559e8b198700014f2ac8e69437bc.zip
cpython-e171edc832a7559e8b198700014f2ac8e69437bc.tar.gz
cpython-e171edc832a7559e8b198700014f2ac8e69437bc.tar.bz2
Fix transient refleak in test_sys.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_sys.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
index 1d0e2ef..6768775 100644
--- a/Lib/test/test_sys.py
+++ b/Lib/test/test_sys.py
@@ -5,6 +5,9 @@ import struct
class SysModuleTest(unittest.TestCase):
+ def tearDown(self):
+ test.test_support.reap_children()
+
def test_original_displayhook(self):
import __builtin__
savestdout = sys.stdout
@@ -257,6 +260,7 @@ class SysModuleTest(unittest.TestCase):
self.current_frames_without_threads()
# Test sys._current_frames() in a WITH_THREADS build.
+ @test.test_support.reap_threads
def current_frames_with_threads(self):
import threading, thread
import traceback
@@ -401,13 +405,13 @@ class SysModuleTest(unittest.TestCase):
env["PYTHONIOENCODING"] = "cp424"
p = subprocess.Popen([sys.executable, "-c", 'print unichr(0xa2)'],
stdout = subprocess.PIPE, env=env)
- out = p.stdout.read().strip()
+ out = p.communicate()[0].strip()
self.assertEqual(out, unichr(0xa2).encode("cp424"))
env["PYTHONIOENCODING"] = "ascii:replace"
p = subprocess.Popen([sys.executable, "-c", 'print unichr(0xa2)'],
stdout = subprocess.PIPE, env=env)
- out = p.stdout.read().strip()
+ out = p.communicate()[0].strip()
self.assertEqual(out, '?')