Skip to content

Commit 6a139d6

Browse files
authored
gh-151728: Partially revert "Clear the typing caches at interpreter shutdown (GH-154858)" (GH-154992)
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.
1 parent 93e2c77 commit 6a139d6

2 files changed

Lines changed: 0 additions & 10 deletions

File tree

Lib/typing.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"""
2020

2121
from abc import abstractmethod, ABCMeta
22-
import atexit
2322
import collections
2423
from collections import defaultdict
2524
import collections.abc
@@ -398,11 +397,6 @@ def _clear_caches():
398397
cleanup()
399398

400399

401-
# Release the LRU caches at shutdown, they otherwise redistribute reference
402-
# leaks of one extension to types of unrelated ones. See GH-151728.
403-
atexit.register(_clear_caches)
404-
405-
406400
def _tp_cache(func=None, /, *, typed=False):
407401
"""Internal wrapper caching __getitem__ of generic types.
408402

Misc/NEWS.d/next/Library/2026-07-29-11-05-00.gh-issue-151728.Kq3vTn.rst

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)