mirror of
https://github.com/python/cpython.git
synced 2025-07-09 20:35:26 +00:00
bpo-33169: Remove values of None
from sys.path_importer_cache when invalidating caches (GH-6402)
An entry of None in sys.path_importer_cache represents a negative/missing finder for a path, so clearing it out makes sense.
This commit is contained in:
parent
3a9ccee0e5
commit
9e2be60634
6 changed files with 652 additions and 620 deletions
|
@ -406,7 +406,7 @@ class InvalidateCacheTests:
|
|||
# There should be no issues if the method is not defined.
|
||||
key = 'gobbledeegook'
|
||||
sys.path_importer_cache[key] = None
|
||||
self.addCleanup(lambda: sys.path_importer_cache.__delitem__(key))
|
||||
self.addCleanup(lambda: sys.path_importer_cache.pop(key, None))
|
||||
self.init.invalidate_caches() # Shouldn't trigger an exception.
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue