Skip to content

Commit

Permalink
Fix stubgen crash when module doesn't set __spec__ (#651)
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul authored Jul 24, 2024
1 parent f2438bb commit 68265d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/stubgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ def process_general(m: Match[str]) -> str:
def is_valid_module(module_name: str) -> bool:
try:
return importlib.util.find_spec(module_name) is not None
except ModuleNotFoundError:
except (ModuleNotFoundError, ValueError):
return False

full_name, mod_name, cls_name = m.group(0), m.group(1)[:-1], m.group(2)
Expand Down

0 comments on commit 68265d3

Please sign in to comment.