Commit 844315c7 authored by Benjamin Peterson's avatar Benjamin Peterson

merge heads

parents 609da58a 7f86811d
...@@ -18,6 +18,8 @@ class CProfileTest(ProfileTest): ...@@ -18,6 +18,8 @@ class CProfileTest(ProfileTest):
def test_bad_counter_during_dealloc(self): def test_bad_counter_during_dealloc(self):
import _lsprof import _lsprof
# Must use a file as StringIO doesn't trigger the bug. # Must use a file as StringIO doesn't trigger the bug.
orig_stderr = sys.stderr
try:
with open(TESTFN, 'w') as file: with open(TESTFN, 'w') as file:
sys.stderr = file sys.stderr = file
try: try:
...@@ -26,7 +28,8 @@ class CProfileTest(ProfileTest): ...@@ -26,7 +28,8 @@ class CProfileTest(ProfileTest):
obj = _lsprof.Profiler(1) obj = _lsprof.Profiler(1)
obj.disable() obj.disable()
finally: finally:
sys.stderr = sys.__stderr__ sys.stderr = orig_stderr
finally:
unlink(TESTFN) unlink(TESTFN)
......
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