[Python-checkins] bpo-46547: remove leaking vars into `pydoc.Helper` namespace (#30957)

JelleZijlstra webhook-mailer at python.org
Mon May 2 18:26:06 EDT 2022


https://github.com/python/cpython/commit/cb6c6648bea57046d5ceff9382f19ebae024b918
commit: cb6c6648bea57046d5ceff9382f19ebae024b918
branch: main
author: Nikita Sobolev <mail at sobolevn.me>
committer: JelleZijlstra <jelle.zijlstra at gmail.com>
date: 2022-05-02T16:25:52-06:00
summary:

bpo-46547: remove leaking vars into `pydoc.Helper` namespace (#30957)

Fixes #90705

files:
A Misc/NEWS.d/next/Library/2022-01-27-14-41-55.bpo-46547.JMyYz9.rst
M Lib/pydoc.py

diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index 12c2bb450e4f5..297ff967a2ce9 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -1891,6 +1891,7 @@ class Helper:
             if topic not in topics:
                 topics = topics + ' ' + topic
             symbols[symbol] = topics
+    del topic, symbols_, symbol, topics
 
     topics = {
         'TYPES': ('types', 'STRINGS UNICODE NUMBERS SEQUENCES MAPPINGS '
diff --git a/Misc/NEWS.d/next/Library/2022-01-27-14-41-55.bpo-46547.JMyYz9.rst b/Misc/NEWS.d/next/Library/2022-01-27-14-41-55.bpo-46547.JMyYz9.rst
new file mode 100644
index 0000000000000..83065a7a06030
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2022-01-27-14-41-55.bpo-46547.JMyYz9.rst
@@ -0,0 +1 @@
+Remove variables leaking into ``pydoc.Helper`` class namespace.



More information about the Python-checkins mailing list