diff options
author | Alex Waygood <Alex.Waygood@Gmail.com> | 2023-05-13 08:55:35 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-13 08:55:35 (GMT) |
commit | c527eb1c2a473df01c19195b378f780e9180fd1c (patch) | |
tree | 6a633c3d205d07a496b85020b8ac344d8e97cee2 /Lib/test/libregrtest | |
parent | 1be80ed107deb15b926f2794b8e6a7a527b8b84c (diff) | |
download | cpython-c527eb1c2a473df01c19195b378f780e9180fd1c.zip cpython-c527eb1c2a473df01c19195b378f780e9180fd1c.tar.gz cpython-c527eb1c2a473df01c19195b378f780e9180fd1c.tar.bz2 |
gh-91896: Revert some very noisy DeprecationWarnings for `ByteString` (#104424)
Diffstat (limited to 'Lib/test/libregrtest')
-rw-r--r-- | Lib/test/libregrtest/refleak.py | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/Lib/test/libregrtest/refleak.py b/Lib/test/libregrtest/refleak.py index 776a9e9..cd11d38 100644 --- a/Lib/test/libregrtest/refleak.py +++ b/Lib/test/libregrtest/refleak.py @@ -48,13 +48,11 @@ def dash_R(ns, test_name, test_func): else: zdc = zipimport._zip_directory_cache.copy() abcs = {} - # catch and ignore collections.abc.ByteString deprecation - with warnings.catch_warnings(action='ignore', category=DeprecationWarning): - for abc in [getattr(collections.abc, a) for a in collections.abc.__all__]: - if not isabstract(abc): - continue - for obj in abc.__subclasses__() + [abc]: - abcs[obj] = _get_dump(obj)[0] + for abc in [getattr(collections.abc, a) for a in collections.abc.__all__]: + if not isabstract(abc): + continue + for obj in abc.__subclasses__() + [abc]: + abcs[obj] = _get_dump(obj)[0] # bpo-31217: Integer pool to get a single integer object for the same # value. The pool is used to prevent false alarm when checking for memory @@ -176,8 +174,7 @@ def dash_R_cleanup(fs, ps, pic, zdc, abcs): # Clear ABC registries, restoring previously saved ABC registries. # ignore deprecation warning for collections.abc.ByteString - with warnings.catch_warnings(action='ignore', category=DeprecationWarning): - abs_classes = [getattr(collections.abc, a) for a in collections.abc.__all__] + abs_classes = [getattr(collections.abc, a) for a in collections.abc.__all__] abs_classes = filter(isabstract, abs_classes) for abc in abs_classes: for obj in abc.__subclasses__() + [abc]: |