Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8015ba3

Browse files
committed
Fixtest_regrtest (hopefully)
1 parent424486a commit8015ba3

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

‎Lib/test/libregrtest/refleak.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,13 @@ def dash_R(ns, test_name, test_func):
4848
else:
4949
zdc=zipimport._zip_directory_cache.copy()
5050
abcs= {}
51-
forabcin [getattr(collections.abc,a)foraincollections.abc.__all__]:
52-
ifnotisabstract(abc):
53-
continue
54-
forobjinabc.__subclasses__()+ [abc]:
55-
abcs[obj]=_get_dump(obj)[0]
51+
# catch and ignore collections.abc.ByteString deprecation
52+
withwarnings.catch_warnings(action='ignore',category=DeprecationWarning):
53+
forabcin [getattr(collections.abc,a)foraincollections.abc.__all__]:
54+
ifnotisabstract(abc):
55+
continue
56+
forobjinabc.__subclasses__()+ [abc]:
57+
abcs[obj]=_get_dump(obj)[0]
5658

5759
# bpo-31217: Integer pool to get a single integer object for the same
5860
# value. The pool is used to prevent false alarm when checking for memory
@@ -173,7 +175,9 @@ def dash_R_cleanup(fs, ps, pic, zdc, abcs):
173175
zipimport._zip_directory_cache.update(zdc)
174176

175177
# Clear ABC registries, restoring previously saved ABC registries.
176-
abs_classes= [getattr(collections.abc,a)foraincollections.abc.__all__]
178+
# ignore deprecation warning for collections.abc.ByteString
179+
withwarnings.catch_warnings(action='ignore',category=DeprecationWarning):
180+
abs_classes= [getattr(collections.abc,a)foraincollections.abc.__all__]
177181
abs_classes=filter(isabstract,abs_classes)
178182
forabcinabs_classes:
179183
forobjinabc.__subclasses__()+ [abc]:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp