Skip to content

Commit 7f325df

Browse files
committed
Handle OSError from stat (fixes #902)
1 parent d07a405 commit 7f325df

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bpython/importcompletion.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,10 @@ def find_modules(self, path: Path) -> Generator[str, None, None]:
212212
else:
213213
if is_package:
214214
path_real = Path(pathname).resolve()
215-
stat = path_real.stat()
215+
try:
216+
stat = path_real.stat()
217+
except OSError:
218+
continue
216219
if (stat.st_dev, stat.st_ino) not in self.paths:
217220
self.paths.add((stat.st_dev, stat.st_ino))
218221
for subname in self.find_modules(path_real):

0 commit comments

Comments
 (0)