Commit 88345683 authored by Victor Stinner's avatar Victor Stinner

Issue #12250: regrtest --timeout displays a warning instead of failing with an

error if faulthandler.dump_tracebacks_later() is missing (e.g. if Python is
compiled without threads).
parent 9e586c2b
......@@ -415,12 +415,13 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
# join it with the saved CWD so it ends up where the user expects.
testdir = os.path.join(support.SAVEDCWD, a)
elif o == '--timeout':
if not hasattr(faulthandler, 'dump_tracebacks_later'):
print("The timeout option requires "
"faulthandler.dump_tracebacks_later", file=sys.stderr)
sys.exit(1)
timeout = float(a)
if timeout <= 0:
if hasattr(faulthandler, 'dump_tracebacks_later'):
timeout = float(a)
if timeout <= 0:
timeout = None
else:
print("Warning: The timeout option requires "
"faulthandler.dump_tracebacks_later")
timeout = None
elif o == '--wait':
input("Press any key to continue...")
......
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