Kaydet (Commit) 836f0e21 authored tarafından Antoine Pitrou's avatar Antoine Pitrou

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.
........
üst 45ebeb8f
......@@ -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'?')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment