Skip to content

Commit f893f55

Browse files
committed
Fix pages is_module_package check
1 parent e04f4f9 commit f893f55

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

dash/_pages.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,10 @@ def _infer_path(module_name, template):
8686

8787

8888
def _module_name_is_package(module_name):
89-
file_path = sys.modules[module_name].__file__
90-
return (
91-
file_path
92-
and module_name in sys.modules
93-
and Path(file_path).name == "__init__.py"
94-
)
89+
if module_name not in sys.modules:
90+
return False
91+
file = sys.modules[module_name].__file__
92+
return file and file.endswith("__init__.py")
9593

9694

9795
def _path_to_module_name(path):

0 commit comments

Comments
 (0)