mirror of https://github.com/python/cpython.git
Issue #23919: Prevents assert dialogs appearing in the test suite.
This commit is contained in:
parent
ce88d82ec2
commit
12ee7448f8
|
@ -511,7 +511,13 @@ def main(tests=None, **kwargs):
|
||||||
import gc
|
import gc
|
||||||
gc.set_threshold(ns.threshold)
|
gc.set_threshold(ns.threshold)
|
||||||
if ns.nowindows:
|
if ns.nowindows:
|
||||||
|
print('The --nowindows (-n) option is deprecated. '
|
||||||
|
'Use -vv to display assertions in stderr.')
|
||||||
|
try:
|
||||||
import msvcrt
|
import msvcrt
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
msvcrt.SetErrorMode(msvcrt.SEM_FAILCRITICALERRORS|
|
msvcrt.SetErrorMode(msvcrt.SEM_FAILCRITICALERRORS|
|
||||||
msvcrt.SEM_NOALIGNMENTFAULTEXCEPT|
|
msvcrt.SEM_NOALIGNMENTFAULTEXCEPT|
|
||||||
msvcrt.SEM_NOGPFAULTERRORBOX|
|
msvcrt.SEM_NOGPFAULTERRORBOX|
|
||||||
|
@ -523,8 +529,11 @@ def main(tests=None, **kwargs):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
for m in [msvcrt.CRT_WARN, msvcrt.CRT_ERROR, msvcrt.CRT_ASSERT]:
|
for m in [msvcrt.CRT_WARN, msvcrt.CRT_ERROR, msvcrt.CRT_ASSERT]:
|
||||||
msvcrt.CrtSetReportMode(m, msvcrt.CRTDBG_MODE_FILE)
|
if ns.verbose and ns.verbose >= 2:
|
||||||
msvcrt.CrtSetReportFile(m, msvcrt.CRTDBG_FILE_STDERR)
|
msvcrt.CrtSetReportMode(m, msvcrt.CRTDBG_MODE_FILE)
|
||||||
|
msvcrt.CrtSetReportFile(m, msvcrt.CRTDBG_FILE_STDERR)
|
||||||
|
else:
|
||||||
|
msvcrt.CrtSetReportMode(m, 0)
|
||||||
if ns.wait:
|
if ns.wait:
|
||||||
input("Press any key to continue...")
|
input("Press any key to continue...")
|
||||||
|
|
||||||
|
|
|
@ -278,6 +278,8 @@ Documentation
|
||||||
Tests
|
Tests
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
- Issue #23919: Prevents assert dialogs appearing in the test suite.
|
||||||
|
|
||||||
- PCbuild\rt.bat now accepts an unlimited number of arguments to pass along
|
- PCbuild\rt.bat now accepts an unlimited number of arguments to pass along
|
||||||
to regrtest.py. Previously there was a limit of 9.
|
to regrtest.py. Previously there was a limit of 9.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue