mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-45410: Enhance libregrtest -W/--verbose3 option (GH-28908)
libregrtest -W/--verbose3 now also replace sys.__stdout__, sys.__stderr__, and stdout and stderr file descriptors (fd 1 and fd 2). support.print_warning() messages are now logged in the expected order. The "./python -m test test_eintr -W" command no longer logs into stdout if the test pass.
This commit is contained in:
parent
2d21612f0d
commit
dbe213de7e
3 changed files with 72 additions and 15 deletions
|
@ -71,7 +71,7 @@ orig_unraisablehook = None
|
|||
def regrtest_unraisable_hook(unraisable):
|
||||
global orig_unraisablehook
|
||||
support.environment_altered = True
|
||||
print_warning("Unraisable exception")
|
||||
support.print_warning("Unraisable exception")
|
||||
old_stderr = sys.stderr
|
||||
try:
|
||||
support.flush_std_streams()
|
||||
|
@ -94,7 +94,7 @@ orig_threading_excepthook = None
|
|||
def regrtest_threading_excepthook(args):
|
||||
global orig_threading_excepthook
|
||||
support.environment_altered = True
|
||||
print_warning(f"Uncaught thread exception: {args.exc_type.__name__}")
|
||||
support.print_warning(f"Uncaught thread exception: {args.exc_type.__name__}")
|
||||
old_stderr = sys.stderr
|
||||
try:
|
||||
support.flush_std_streams()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue