summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-11-21 15:44:01 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-11-21 15:44:01 (GMT)
commit6c7fb55d4491327d07f7a33ce25498ac2e871818 (patch)
treef7ac2e9bb47480d76c9914cb6cf8bd0a3d65e6cc
parent6a4d7629da5fb67458089265c8971c1eec64e07a (diff)
downloadcpython-6c7fb55d4491327d07f7a33ce25498ac2e871818.zip
cpython-6c7fb55d4491327d07f7a33ce25498ac2e871818.tar.gz
cpython-6c7fb55d4491327d07f7a33ce25498ac2e871818.tar.bz2
Issue #28688: Remove warnings.filters check from regrtest
Reloading the warnings module duplicates filters in warnings.filters. Fixing the issue is tricky. It was decided to simply remove the check from Python 3.5, since the bug only impacts Python unit tests, not real applications. The check is kept in Python 3.6 and newer.
-rwxr-xr-xLib/test/regrtest.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
index db29efa..6b7ce16 100755
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -1052,7 +1052,7 @@ class saved_test_environment:
resources = ('sys.argv', 'cwd', 'sys.stdin', 'sys.stdout', 'sys.stderr',
'os.environ', 'sys.path', 'sys.path_hooks', '__import__',
- 'warnings.filters', 'asyncore.socket_map',
+ 'asyncore.socket_map',
'logging._handlers', 'logging._handlerList', 'sys.gettrace',
'sys.warnoptions',
# multiprocessing.process._cleanup() may release ref
@@ -1118,12 +1118,6 @@ class saved_test_environment:
def restore___import__(self, import_):
builtins.__import__ = import_
- def get_warnings_filters(self):
- return id(warnings.filters), warnings.filters, warnings.filters[:]
- def restore_warnings_filters(self, saved_filters):
- warnings.filters = saved_filters[1]
- warnings.filters[:] = saved_filters[2]
-
def get_asyncore_socket_map(self):
asyncore = sys.modules.get('asyncore')
# XXX Making a copy keeps objects alive until __exit__ gets called.