diff --git a/Lib/typing.py b/Lib/typing.py index 809c0ff88607a5..a05d73c29cf95e 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -19,7 +19,6 @@ """ from abc import abstractmethod, ABCMeta -import atexit import collections from collections import defaultdict import collections.abc @@ -398,11 +397,6 @@ def _clear_caches(): cleanup() -# Release the LRU caches at shutdown, they otherwise redistribute reference -# leaks of one extension to types of unrelated ones. See GH-151728. -atexit.register(_clear_caches) - - def _tp_cache(func=None, /, *, typed=False): """Internal wrapper caching __getitem__ of generic types. diff --git a/Misc/NEWS.d/next/Library/2026-07-29-11-05-00.gh-issue-151728.Kq3vTn.rst b/Misc/NEWS.d/next/Library/2026-07-29-11-05-00.gh-issue-151728.Kq3vTn.rst deleted file mode 100644 index 39c63a1aea3193..00000000000000 --- a/Misc/NEWS.d/next/Library/2026-07-29-11-05-00.gh-issue-151728.Kq3vTn.rst +++ /dev/null @@ -1,4 +0,0 @@ -Clear the internal :mod:`typing` caches from an exit handler. Previously, an -extension module that leaked a reference to :mod:`typing` would also keep every -subscripted type alive past interpreter shutdown, including types owned by -unrelated extension modules.