diff options
| author | Brett Cannon <brett@python.org> | 2013-01-11 15:42:30 -0500 |
|---|---|---|
| committer | Brett Cannon <brett@python.org> | 2013-01-11 15:42:30 -0500 |
| commit | c57f9f9419154ffa6b653da58a7eb3f35da478c7 (patch) | |
| tree | ae79b45e2bcc73b81eee8c201d4c38c24df190dc /Lib/importlib | |
| parent | b463c482bf6506095f5f11c4f650b7ae356f4452 (diff) | |
| parent | a9976b3e32b612e33dc9f6d8874a88d028de7424 (diff) | |
| download | cpython-git-c57f9f9419154ffa6b653da58a7eb3f35da478c7.tar.gz | |
Merge from 3.3 for fix for issue #16730
Diffstat (limited to 'Lib/importlib')
| -rw-r--r-- | Lib/importlib/_bootstrap.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py index c71d67d9fd..f9d9ad484f 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. |
