Blob Blame History Raw
commit ea4d6a12548eea7ce0424feea13a499fb7085e96
Author: rpm-build <rpm-build>
Date:   Wed Mar 29 04:31:55 2017 +0200

    011-no-faulthandler.patch

diff --git a/lib-python/3/test/support/__init__.py b/lib-python/3/test/support/__init__.py
index 5d7f308..4424637 100644
--- a/lib-python/3/test/support/__init__.py
+++ b/lib-python/3/test/support/__init__.py
@@ -6,7 +6,6 @@ if __name__ != 'test.support':
 import collections.abc
 import contextlib
 import errno
-import faulthandler
 import fnmatch
 import functools
 import gc
@@ -65,6 +64,11 @@ try:
 except ImportError:
     resource = None
 
+try:
+    import faulthandler
+except ImportError:
+    faulthandler = None
+
 __all__ = [
     # globals
     "PIPE_MAX_SIZE", "verbose", "max_memuse", "use_resources", "failfast",
@@ -2060,7 +2064,8 @@ def start_threads(threads, unlock=None):
         finally:
             started = [t for t in started if t.isAlive()]
             if started:
-                faulthandler.dump_traceback(sys.stdout)
+                if faulthandler is not None:
+                    faulthandler.dump_traceback(sys.stdout)
                 raise AssertionError('Unable to join %d threads' % len(started))
 
 @contextlib.contextmanager