From 7d648a0cecfc90bb1b24e4effd5ee9020167c064 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 31 Mar 2011 18:27:50 +0200 Subject: [PATCH] Issue #11727: Antoine and Arfrever don't like "0 < timeout" style (regrtest.py) --- Lib/test/regrtest.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index f14b89d6223..8e9fe656c2a 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -818,7 +818,8 @@ def runtest(test, verbose, quiet, support.verbose = verbose # Tell tests to be moderately quiet if use_resources is not None: support.use_resources = use_resources - if timeout is not None and timeout > 0: + use_timeout = (timeout is not None and timeout > 0) + if use_timeout: faulthandler.dump_tracebacks_later(timeout, exit=True) try: result = runtest_inner(test, verbose, quiet, huntrleaks, debug) @@ -830,7 +831,7 @@ def runtest(test, verbose, quiet, runtest(test, True, quiet, huntrleaks, debug, timeout=timeout) return result finally: - if timeout and 0 < timeout: + if use_timeout: faulthandler.cancel_dump_tracebacks_later() cleanup_test_droppings(test, verbose)