Unfortunately, this change causes reference leak tests to fail.
This only reverts the `atexit` registration: it leaves the `_clear_caches` function, to simplify the regrtest utils code a bit.
"""
from abc import abstractmethod, ABCMeta
-import atexit
import collections
from collections import defaultdict
import collections.abc
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.
+++ /dev/null
-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.