diff options
author | Alex Waygood <Alex.Waygood@Gmail.com> | 2023-05-09 12:33:36 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-09 12:33:36 (GMT) |
commit | 9196da417d20e1484e23b3c80483b0222abaadf2 (patch) | |
tree | 866a8a6d7238bc5b09986753cce9fd6049c62f16 | |
parent | 41aff464cef83d2655029ddd180a51110e8d7f8e (diff) | |
download | cpython-9196da417d20e1484e23b3c80483b0222abaadf2.zip cpython-9196da417d20e1484e23b3c80483b0222abaadf2.tar.gz cpython-9196da417d20e1484e23b3c80483b0222abaadf2.tar.bz2 |
gh-103193: Fix refleaks in `test_inspect` and `test_typing` (#104320)
-rw-r--r-- | Lib/test/libregrtest/utils.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/libregrtest/utils.py b/Lib/test/libregrtest/utils.py index fb13fa0..fd46819 100644 --- a/Lib/test/libregrtest/utils.py +++ b/Lib/test/libregrtest/utils.py @@ -210,6 +210,13 @@ def clear_caches(): else: fractions._hash_algorithm.cache_clear() + try: + inspect = sys.modules['inspect'] + except KeyError: + pass + else: + inspect._shadowed_dict_from_mro_tuple.cache_clear() + def get_build_info(): # Get most important configure and build options as a list of strings. |