mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
Fix test_atexit so that it still passes when -3 is supplied. (It was catching the warning messages on stdio from using the reload() function.)
This commit is contained in:
parent
f48da8fbcd
commit
a7a3e28e4e
1 changed files with 2 additions and 2 deletions
|
@ -41,13 +41,13 @@ class TestCase(unittest.TestCase):
|
|||
|
||||
def test_sys_override(self):
|
||||
# be sure a preset sys.exitfunc is handled properly
|
||||
s = StringIO.StringIO()
|
||||
sys.stdout = sys.stderr = s
|
||||
save_handlers = atexit._exithandlers
|
||||
atexit._exithandlers = []
|
||||
exfunc = sys.exitfunc
|
||||
sys.exitfunc = self.h1
|
||||
reload(atexit)
|
||||
s = StringIO.StringIO()
|
||||
sys.stdout = sys.stderr = s
|
||||
try:
|
||||
atexit.register(self.h2)
|
||||
atexit._run_exitfuncs()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue