@@ -240,7 +240,7 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
240240 findleaks = False , use_resources = None , trace = False , coverdir = 'coverage' ,
241241 runleaks = False , huntrleaks = False , verbose2 = False , print_slow = False ,
242242 random_seed = None , use_mp = None , verbose3 = False , forever = False ,
243- header = False , timeout = 60 * 60 ):
243+ header = False ):
244244 """Execute a test suite.
245245
246246 This also parses command-line options and modifies its behavior
@@ -263,6 +263,10 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
263263 directly to set the values that would normally be set by flags
264264 on the command line.
265265 """
266+ if hasattr (faulthandler , 'dump_tracebacks_later' ):
267+ timeout = 60 * 60
268+ else :
269+ timeout = None
266270
267271 replace_stdout ()
268272
@@ -409,6 +413,10 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
409413 # join it with the saved CWD so it ends up where the user expects.
410414 testdir = os .path .join (support .SAVEDCWD , a )
411415 elif o == '--timeout' :
416+ if not hasattr (faulthandler , 'dump_tracebacks_later' ):
417+ print ("--timeout option requires "
418+ "faulthandler.dump_tracebacks_later" , file = sys .stderr )
419+ sys .exit (1 )
412420 timeout = float (a )
413421 else :
414422 print (("No handler for option {}. Please report this as a bug "
0 commit comments