summaryrefslogtreecommitdiffstats
path: root/Lib/importlib
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2013-01-11 20:42:30 (GMT)
committerBrett Cannon <brett@python.org>2013-01-11 20:42:30 (GMT)
commitc57f9f9419154ffa6b653da58a7eb3f35da478c7 (patch)
treeae79b45e2bcc73b81eee8c201d4c38c24df190dc /Lib/importlib
parentb463c482bf6506095f5f11c4f650b7ae356f4452 (diff)
parenta9976b3e32b612e33dc9f6d8874a88d028de7424 (diff)
downloadcpython-c57f9f9419154ffa6b653da58a7eb3f35da478c7.zip
cpython-c57f9f9419154ffa6b653da58a7eb3f35da478c7.tar.gz
cpython-c57f9f9419154ffa6b653da58a7eb3f35da478c7.tar.bz2
Merge from 3.3 for fix for issue #16730
Diffstat (limited to 'Lib/importlib')
-rw-r--r--Lib/importlib/_bootstrap.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py
index c71d67d..f9d9ad4 100644
--- a/Lib/importlib/_bootstrap.py
+++ b/Lib/importlib/_bootstrap.py
@@ -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.