GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Handle OSError again · apporc/bpython@1fb4041

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • bpython
    • importcompletion.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎bpython/importcompletion.py‎

Copy file name to clipboardExpand all lines: bpython/importcompletion.py
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,14 @@ def find_modules(self, path: Path) -> Generator[Optional[str], None, None]:
175175
# Path is on skiplist
176176
return
177177

178+
try:
179+
children = path.iterdir()
180+
except OSError:
181+
# Path is not readable
182+
return
183+
178184
finder = importlib.machinery.FileFinder(str(path), *LOADERS) # type: ignore
179-
for p in path.iterdir():
185+
for p in children:
180186
if p.name.startswith(".") or p.name == "__pycache__":
181187
# Impossible to import from names starting with . and we can skip __pycache__
182188
continue

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.