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