Skip to content

Commit

Permalink
Update is_module check
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter554 committed Oct 18, 2023
1 parent d3890db commit 3a7dad1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion codemodimportfrom/codemodimportfrom.py
Expand Up @@ -157,7 +157,9 @@ def _matches_qualified_name_to_leave(self, qualified_name: str) -> bool:
def _is_module(self, path: str) -> bool:
try:
importlib.import_module(path)
except Exception:
except ModuleNotFoundError:
return False
except Exception:
return True
else:
return True
2 changes: 1 addition & 1 deletion pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "codemodimportfrom"
version = "0.9.0"
version = "0.10.0"
description = ""
authors = ["Your Name <you@example.com>"]
readme = "README.md"
Expand Down

0 comments on commit 3a7dad1

Please sign in to comment.