mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-45410: regrtest -W leaves stdout/err FD unchanged (GH-28915)
support.print_warning() now stores the original value of
sys.__stderr__ and uses it to log warnings. libregrtest uses the same
stream to log unraisable exceptions and uncaught threading
exceptions.
Partially revert commit dbe213de7e
:
libregrtest no longer replaces sys.__stdout__, sys.__stderr__, and
stdout and stderr file descriptors.
Remove also a few unused imports in libregrtest.
This commit is contained in:
parent
380c440875
commit
7733307739
7 changed files with 19 additions and 82 deletions
|
@ -75,7 +75,7 @@ def regrtest_unraisable_hook(unraisable):
|
|||
old_stderr = sys.stderr
|
||||
try:
|
||||
support.flush_std_streams()
|
||||
sys.stderr = sys.__stderr__
|
||||
sys.stderr = support.print_warning.orig_stderr
|
||||
orig_unraisablehook(unraisable)
|
||||
sys.stderr.flush()
|
||||
finally:
|
||||
|
@ -98,7 +98,7 @@ def regrtest_threading_excepthook(args):
|
|||
old_stderr = sys.stderr
|
||||
try:
|
||||
support.flush_std_streams()
|
||||
sys.stderr = sys.__stderr__
|
||||
sys.stderr = support.print_warning.orig_stderr
|
||||
orig_threading_excepthook(args)
|
||||
sys.stderr.flush()
|
||||
finally:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue