95 lines
2.9 KiB
Diff
95 lines
2.9 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/regrtest.py b/lib-python/3/test/regrtest.py
|
|
index c1d85f6..3d3072c 100755
|
|
--- a/lib-python/3/test/regrtest.py
|
|
+++ b/lib-python/3/test/regrtest.py
|
|
@@ -124,7 +124,6 @@ import importlib
|
|
|
|
import argparse
|
|
import builtins
|
|
-import faulthandler
|
|
import io
|
|
import json
|
|
import locale
|
|
@@ -152,7 +151,10 @@ try:
|
|
import _multiprocessing, 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
|
|
# Lib/) and, if we change the CWD to run the tests in a temporary dir, some
|
|
@@ -486,17 +488,18 @@ def main(tests=None, **kwargs):
|
|
directly to set the values that would normally be set by flags
|
|
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()
|
|
|
|
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
|