Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
7acffa23
Commit
7acffa23
authored
Mar 05, 2017
by
Ivan Levkivskyi
Committed by
Serhiy Storchaka
Mar 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-29638: Fix spurious refleaks after typing is imported (#469)
parent
c6b448b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
Lib/test/libregrtest/refleak.py
Lib/test/libregrtest/refleak.py
+8
-3
No files found.
Lib/test/libregrtest/refleak.py
View file @
7acffa23
...
...
@@ -143,9 +143,14 @@ def dash_R_cleanup(fs, ps, pic, zdc, abcs):
sys
.
_clear_type_cache
()
# Clear ABC registries, restoring previously saved ABC registries.
for
abc
in
[
getattr
(
collections
.
abc
,
a
)
for
a
in
collections
.
abc
.
__all__
]:
if
not
isabstract
(
abc
):
continue
abs_classes
=
[
getattr
(
collections
.
abc
,
a
)
for
a
in
collections
.
abc
.
__all__
]
abs_classes
=
filter
(
isabstract
,
abs_classes
)
if
'typing'
in
sys
.
modules
:
t
=
sys
.
modules
[
'typing'
]
# These classes require special treatment because they do not appear
# in direct subclasses of collections.abc classes
abs_classes
=
list
(
abs_classes
)
+
[
t
.
ChainMap
,
t
.
Counter
,
t
.
DefaultDict
]
for
abc
in
abs_classes
:
for
obj
in
abc
.
__subclasses__
()
+
[
abc
]:
obj
.
_abc_registry
=
abcs
.
get
(
obj
,
WeakSet
()).
copy
()
obj
.
_abc_cache
.
clear
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment