Skip to content

Commit fd81999

Browse files
committed
Catch exceptions
1 parent 10da15b commit fd81999

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Lib/_pyrepl/_module_completer.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@ def get_completions(self, line: str) -> list[str]:
4141
result = ImportParser(line).parse()
4242
if not result:
4343
return []
44-
return self.complete(*result)
44+
try:
45+
return self.complete(*result)
46+
except Exception:
47+
# Some unexpected error occurred, make it look like
48+
# no completions are available
49+
return []
4550

4651
def complete(self, from_name: str | None, name: str | None) -> list[str]:
4752
if from_name is None:

0 commit comments

Comments
 (0)