Skip to content

Commit 274f423

Browse files
committed
Remove < 3.8 workaround
1 parent 46dc081 commit 274f423

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

bpython/importcompletion.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -175,17 +175,8 @@ def find_modules(self, path: Path) -> Generator[Optional[str], None, None]:
175175
# Path is on skiplist
176176
return
177177

178-
try:
179-
# https://bugs.python.org/issue34541
180-
# Once we migrate to Python 3.8, we can change it back to directly iterator over
181-
# path.iterdir().
182-
children = tuple(path.iterdir())
183-
except OSError:
184-
# Path is not readable
185-
return
186-
187178
finder = importlib.machinery.FileFinder(str(path), *LOADERS) # type: ignore
188-
for p in children:
179+
for p in path.iterdir():
189180
if p.name.startswith(".") or p.name == "__pycache__":
190181
# Impossible to import from names starting with . and we can skip __pycache__
191182
continue

0 commit comments

Comments
 (0)