From 3c5fd62f9374d43ea0611f92b0285bfd252c3178 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Thu, 27 Jan 2022 14:26:25 +0300 Subject: [PATCH] bpo-46546: remove `method_name` var leak from `importlib.DeprecatedList` --- Lib/importlib/metadata/__init__.py | 1 + .../next/Library/2022-01-27-14-25-42.bpo-46546.rpSN2y.rst | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2022-01-27-14-25-42.bpo-46546.rpSN2y.rst diff --git a/Lib/importlib/metadata/__init__.py b/Lib/importlib/metadata/__init__.py index 371c4822095862..9397191648298b 100644 --- a/Lib/importlib/metadata/__init__.py +++ b/Lib/importlib/metadata/__init__.py @@ -305,6 +305,7 @@ def wrapped(self, *args, **kwargs): 'sort', ]: locals()[method_name] = _wrap_deprecated_method(method_name) + del method_name def __add__(self, other): if not isinstance(other, tuple): diff --git a/Misc/NEWS.d/next/Library/2022-01-27-14-25-42.bpo-46546.rpSN2y.rst b/Misc/NEWS.d/next/Library/2022-01-27-14-25-42.bpo-46546.rpSN2y.rst new file mode 100644 index 00000000000000..9f81621115db6e --- /dev/null +++ b/Misc/NEWS.d/next/Library/2022-01-27-14-25-42.bpo-46546.rpSN2y.rst @@ -0,0 +1,2 @@ +Remove ``method_name`` var leak from +:class:`importlib.metadata.DeprecatedList`.