Skip to content

Commit 98bd328

Browse files
ilevkivskyigvanrossum
authored andcommitted
Backport _cleanups to Python 2 (#326)
backport of #325 to Python 2
1 parent 01900fb commit 98bd328

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

python2/typing.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,9 +665,13 @@ def _check_generic(cls, parameters):
665665
("many" if alen > elen else "few", repr(cls), alen, elen))
666666

667667

668+
_cleanups = []
669+
670+
668671
def _tp_cache(func):
669672
maxsize = 128
670673
cache = {}
674+
_cleanups.append(cache.clear)
671675

672676
@functools.wraps(func)
673677
def inner(*args):

0 commit comments

Comments
 (0)