[Python-checkins] cpython: Fix #11825: disable regrtest timeout if Python doesn't support threads

victor.stinner python-checkins at python.org
Wed Apr 13 01:07:12 CEST 2011


http://hg.python.org/cpython/rev/64e8d371812c
changeset:   69283:64e8d371812c
parent:      69281:69573aab3ea7
user:        Victor Stinner <victor.stinner at haypocalc.com>
date:        Wed Apr 13 01:06:27 2011 +0200
summary:
  Fix #11825: disable regrtest timeout if Python doesn't support threads

files:
  Lib/test/regrtest.py |  10 +++++++++-
  1 files changed, 9 insertions(+), 1 deletions(-)


diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -240,7 +240,7 @@
          findleaks=False, use_resources=None, trace=False, coverdir='coverage',
          runleaks=False, huntrleaks=False, verbose2=False, print_slow=False,
          random_seed=None, use_mp=None, verbose3=False, forever=False,
-         header=False, timeout=60*60):
+         header=False):
     """Execute a test suite.
 
     This also parses command-line options and modifies its behavior
@@ -263,6 +263,10 @@
     directly to set the values that would normally be set by flags
     on the command line.
     """
+    if hasattr(faulthandler, 'dump_tracebacks_later'):
+        timeout = 60*60
+    else:
+        timeout = None
 
     replace_stdout()
 
@@ -409,6 +413,10 @@
             # 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("--timeout option requires "
+                      "faulthandler.dump_tracebacks_later", file=sys.stderr)
+                sys.exit(1)
             timeout = float(a)
         else:
             print(("No handler for option {}.  Please report this as a bug "

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list