Blob Blame History Raw
diff --git pypy3-v5.5.0-src/lib-python/3/test/regrtest.py pypy3-v5.5.0-src/lib-python/3/test/regrtest.py-new
index 8d18a9297a..e99322ebe1 100755
--- pypy3-v5.5.0-src/lib-python/3/test/regrtest.py
+++ pypy3-v5.5.0-src/lib-python/3/test/regrtest.py-new
@@ -169,7 +169,6 @@ option '-uall,-gui'.
 import importlib
 
 import builtins
-import faulthandler
 import getopt
 import io
 import json
@@ -197,6 +196,10 @@ try:
     import multiprocessing.process
 except ImportError:
     multiprocessing = None
+try:
+    import faulthandler
+except ImportError:
+    faulthandler = None
 
 
 # Some times __path__ and __file__ are not absolute (e.g. while running from
@@ -283,17 +286,18 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
     on the command line.
     """
 
-    # Display the Python traceback on fatal errors (e.g. segfault)
-    faulthandler.enable(all_threads=True)
-
-    # Display the Python traceback on SIGALRM or SIGUSR1 signal
-    signals = []
-    if hasattr(signal, 'SIGALRM'):
-        signals.append(signal.SIGALRM)
-    if hasattr(signal, 'SIGUSR1'):
-        signals.append(signal.SIGUSR1)
-    for signum in signals:
-        faulthandler.register(signum, chain=True)
+    if faulthandler:
+        # Display the Python traceback on fatal errors (e.g. segfault)
+        faulthandler.enable(all_threads=True)
+
+        # Display the Python traceback on SIGALRM or SIGUSR1 signal
+        signals = []
+        if hasattr(signal, 'SIGALRM'):
+            signals.append(signal.SIGALRM)
+        if hasattr(signal, 'SIGUSR1'):
+            signals.append(signal.SIGUSR1)
+        for signum in signals:
+            faulthandler.register(signum, chain=True)
 
     replace_stdout()