Skip to content

Commit c5fce57

Browse files
committed
In PathFinder.invalidate_caches, also invoke MetadataPathFinder.invalidate_caches.
1 parent 7f418fb commit c5fce57

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Lib/importlib/_bootstrap_external.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1470,6 +1470,9 @@ def invalidate_caches():
14701470
# https://bugs.python.org/issue45703
14711471
_NamespacePath._epoch += 1
14721472

1473+
from importlib.metadata import MetadataPathFinder
1474+
MetadataPathFinder().invalidate_caches()
1475+
14731476
@staticmethod
14741477
def _path_hooks(path):
14751478
"""Search sys.path_hooks for a finder for 'path'."""

0 commit comments

Comments
 (0)