summaryrefslogtreecommitdiffstats
path: root/Lib/warnings.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-11-27 15:57:07 (GMT)
committerGitHub <noreply@github.com>2017-11-27 15:57:07 (GMT)
commitc9758784eb321fb9771e0bc7205b296e4d658045 (patch)
tree1436050bd6f4c967283112fd0fa7b6ffe96af2b0 /Lib/warnings.py
parent21c7730761e2a768e33b89b063a095d007dcfd2c (diff)
downloadcpython-c9758784eb321fb9771e0bc7205b296e4d658045.zip
cpython-c9758784eb321fb9771e0bc7205b296e4d658045.tar.gz
cpython-c9758784eb321fb9771e0bc7205b296e4d658045.tar.bz2
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.
Diffstat (limited to 'Lib/warnings.py')
-rw-r--r--Lib/warnings.py1
1 files changed, 0 insertions, 1 deletions
diff --git a/Lib/warnings.py b/Lib/warnings.py
index c4bb22e..d7ea057 100644
--- a/Lib/warnings.py
+++ b/Lib/warnings.py
@@ -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