Merge from 3.3 for fix for issue #16730

This commit is contained in:
Brett Cannon 2013-01-11 15:42:30 -05:00
commit c57f9f9419
4 changed files with 992 additions and 948 deletions

View file

@ -1401,8 +1401,9 @@ class FileFinder:
path = self.path
try:
contents = _os.listdir(path)
except FileNotFoundError:
# Directory has been removed since last import
except (FileNotFoundError, PermissionError, NotADirectoryError):
# Directory has either been removed, turned into a file, or made
# unreadable.
contents = []
# We store two cached versions, to handle runtime changes of the
# PYTHONCASEOK environment variable.