mirror of
https://github.com/python/cpython.git
synced 2025-08-23 10:16:01 +00:00
bpo-27535: Fix memory leak with warnings ignore (#4489)
The warnings module doesn't leak memory anymore in the hidden warnings registry for the "ignore" action of warnings filters. The warn_explicit() function doesn't add the warning key to the registry anymore for the "ignore" action.
This commit is contained in:
parent
21c7730761
commit
c9758784eb
4 changed files with 14 additions and 5 deletions
|
@ -364,7 +364,6 @@ def warn_explicit(message, category, filename, lineno,
|
|||
action = defaultaction
|
||||
# Early exit actions
|
||||
if action == "ignore":
|
||||
registry[key] = 1
|
||||
return
|
||||
|
||||
# Prime the linecache for formatting, in case the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue