diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-11-27 16:57:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-27 16:57:07 +0100 |
commit | c9758784eb321fb9771e0bc7205b296e4d658045 (patch) | |
tree | 1436050bd6f4c967283112fd0fa7b6ffe96af2b0 /Lib/test | |
parent | 21c7730761e2a768e33b89b063a095d007dcfd2c (diff) | |
download | cpython-git-c9758784eb321fb9771e0bc7205b296e4d658045.tar.gz |
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/test')
-rw-r--r-- | Lib/test/test_warnings/__init__.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/test/test_warnings/__init__.py b/Lib/test/test_warnings/__init__.py index e007dc7e39..f2fdaa5386 100644 --- a/Lib/test/test_warnings/__init__.py +++ b/Lib/test/test_warnings/__init__.py @@ -125,6 +125,7 @@ class FilterTests(BaseTest): self.module.filterwarnings("ignore", category=UserWarning) self.module.warn("FilterTests.test_ignore", UserWarning) self.assertEqual(len(w), 0) + self.assertEqual(list(__warningregistry__), ['version']) def test_ignore_after_default(self): with original_warnings.catch_warnings(record=True, |