|
 |
6eb88b1 |
commit ea4d6a12548eea7ce0424feea13a499fb7085e96
|
|
 |
6eb88b1 |
Author: rpm-build <rpm-build>
|
|
 |
6eb88b1 |
Date: Wed Mar 29 04:31:55 2017 +0200
|
|
 |
6eb88b1 |
|
|
 |
6eb88b1 |
011-no-faulthandler.patch
|
|
 |
6eb88b1 |
|
|
 |
6eb88b1 |
diff --git a/lib-python/3/test/regrtest.py b/lib-python/3/test/regrtest.py
|
|
 |
6eb88b1 |
index c1d85f6..3d3072c 100755
|
|
 |
6eb88b1 |
--- a/lib-python/3/test/regrtest.py
|
|
 |
6eb88b1 |
+++ b/lib-python/3/test/regrtest.py
|
|
 |
6eb88b1 |
@@ -124,7 +124,6 @@ import importlib
|
|
 |
aa6a9d0 |
|
|
 |
6eb88b1 |
import argparse
|
|
 |
aa6a9d0 |
import builtins
|
|
 |
aa6a9d0 |
-import faulthandler
|
|
 |
aa6a9d0 |
import io
|
|
 |
aa6a9d0 |
import json
|
|
 |
6eb88b1 |
import locale
|
|
 |
6eb88b1 |
@@ -152,7 +151,10 @@ try:
|
|
 |
6eb88b1 |
import _multiprocessing, multiprocessing.process
|
|
 |
aa6a9d0 |
except ImportError:
|
|
 |
aa6a9d0 |
multiprocessing = None
|
|
 |
6eb88b1 |
-
|
|
 |
aa6a9d0 |
+try:
|
|
 |
aa6a9d0 |
+ import faulthandler
|
|
 |
aa6a9d0 |
+except ImportError:
|
|
 |
aa6a9d0 |
+ faulthandler = None
|
|
 |
aa6a9d0 |
|
|
 |
aa6a9d0 |
# Some times __path__ and __file__ are not absolute (e.g. while running from
|
|
 |
6eb88b1 |
# Lib/) and, if we change the CWD to run the tests in a temporary dir, some
|
|
 |
6eb88b1 |
@@ -486,17 +488,18 @@ def main(tests=None, **kwargs):
|
|
 |
6eb88b1 |
directly to set the values that would normally be set by flags
|
|
 |
aa6a9d0 |
on the command line.
|
|
 |
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 |
|
|
 |
6eb88b1 |
diff --git a/lib-python/3/test/support/__init__.py b/lib-python/3/test/support/__init__.py
|
|
 |
6eb88b1 |
index 5d7f308..4424637 100644
|
|
 |
6eb88b1 |
--- a/lib-python/3/test/support/__init__.py
|
|
 |
6eb88b1 |
+++ b/lib-python/3/test/support/__init__.py
|
|
 |
6eb88b1 |
@@ -6,7 +6,6 @@ if __name__ != 'test.support':
|
|
 |
6eb88b1 |
import collections.abc
|
|
 |
6eb88b1 |
import contextlib
|
|
 |
6eb88b1 |
import errno
|
|
 |
6eb88b1 |
-import faulthandler
|
|
 |
6eb88b1 |
import fnmatch
|
|
 |
6eb88b1 |
import functools
|
|
 |
6eb88b1 |
import gc
|
|
 |
6eb88b1 |
@@ -65,6 +64,11 @@ try:
|
|
 |
6eb88b1 |
except ImportError:
|
|
 |
6eb88b1 |
resource = None
|
|
 |
6eb88b1 |
|
|
 |
6eb88b1 |
+try:
|
|
 |
6eb88b1 |
+ import faulthandler
|
|
 |
6eb88b1 |
+except ImportError:
|
|
 |
6eb88b1 |
+ faulthandler = None
|
|
 |
6eb88b1 |
+
|
|
 |
6eb88b1 |
__all__ = [
|
|
 |
6eb88b1 |
# globals
|
|
 |
6eb88b1 |
"PIPE_MAX_SIZE", "verbose", "max_memuse", "use_resources", "failfast",
|
|
 |
6eb88b1 |
@@ -2060,7 +2064,8 @@ def start_threads(threads, unlock=None):
|
|
 |
6eb88b1 |
finally:
|
|
 |
6eb88b1 |
started = [t for t in started if t.isAlive()]
|
|
 |
6eb88b1 |
if started:
|
|
 |
6eb88b1 |
- faulthandler.dump_traceback(sys.stdout)
|
|
 |
6eb88b1 |
+ if faulthandler is not None:
|
|
 |
6eb88b1 |
+ faulthandler.dump_traceback(sys.stdout)
|
|
 |
6eb88b1 |
raise AssertionError('Unable to join %d threads' % len(started))
|
|
 |
6eb88b1 |
|
|
 |
6eb88b1 |
@contextlib.contextmanager
|