Skip to content

Commit 9196da4

Browse files
authored
gh-103193: Fix refleaks in test_inspect and test_typing (#104320)
1 parent 41aff46 commit 9196da4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Lib/test/libregrtest/utils.py

+7
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,13 @@ def clear_caches():
210210
else:
211211
fractions._hash_algorithm.cache_clear()
212212

213+
try:
214+
inspect = sys.modules['inspect']
215+
except KeyError:
216+
pass
217+
else:
218+
inspect._shadowed_dict_from_mro_tuple.cache_clear()
219+
213220

214221
def get_build_info():
215222
# Get most important configure and build options as a list of strings.

0 commit comments

Comments
 (0)