From c9758784eb321fb9771e0bc7205b296e4d658045 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 27 Nov 2017 16:57:07 +0100 Subject: 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. --- Lib/warnings.py | 1 - 1 file changed, 1 deletion(-) (limited to 'Lib/warnings.py') diff --git a/Lib/warnings.py b/Lib/warnings.py index c4bb22ec92..d7ea057a68 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 -- cgit v1.2.1