mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
Close #14846: Handle a sys.path entry going away
This commit is contained in:
parent
db7920b978
commit
48fec05391
4 changed files with 957 additions and 937 deletions
|
@ -1367,7 +1367,11 @@ class FileFinder:
|
|||
def _fill_cache(self):
|
||||
"""Fill the cache of potential modules and packages for this directory."""
|
||||
path = self.path
|
||||
contents = _os.listdir(path)
|
||||
try:
|
||||
contents = _os.listdir(path)
|
||||
except FileNotFoundError:
|
||||
# Directory has been removed since last import
|
||||
contents = []
|
||||
# We store two cached versions, to handle runtime changes of the
|
||||
# PYTHONCASEOK environment variable.
|
||||
if not sys.platform.startswith('win'):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue