pypy3.9/011-no-faulthandler.patch
2021-05-26 13:29:10 +02:00

41 lines
1.2 KiB
Diff

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 faa1ba7..2edadc9 100644
--- a/lib-python/3/test/support/__init__.py
+++ b/lib-python/3/test/support/__init__.py
@@ -7,7 +7,6 @@ import collections.abc
import contextlib
import datetime
import errno
-import faulthandler
import fnmatch
import functools
import gc
@@ -70,6 +69,11 @@ try:
except ImportError:
resource = None
+try:
+ import faulthandler
+except ImportError:
+ faulthandler = None
+
__all__ = [
# globals
"PIPE_MAX_SIZE", "verbose", "max_memuse", "use_resources", "failfast",
@@ -2231,7 +2235,8 @@ def start_threads(threads, unlock=None):
finally:
started = [t for t in started if t.is_alive()]
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