We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 12e9ce1 commit a82623eCopy full SHA for a82623e
bpython/importcompletion.py
@@ -136,8 +136,17 @@ def find_modules(self, path):
136
# Path is on skiplist
137
return
138
139
+ try:
140
+ # https://bugs.python.org/issue34541
141
+ # Once we migrate to Python 3.8, we can change it back to directly iterator over
142
+ # path.iterdir().
143
+ children = tuple(path.iterdir())
144
+ except OSError:
145
+ # Path is not readable
146
+ return
147
+
148
finder = importlib.machinery.FileFinder(str(path))
- for p in path.iterdir():
149
+ for p in children:
150
if any(fnmatch.fnmatch(p.name, entry) for entry in self.skiplist):
151
152
continue
0 commit comments