Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: Dash Testing

on:
push:
branches:
- dev
- master
pull_request:
workflow_dispatch:

jobs:
Expand Down
10 changes: 4 additions & 6 deletions dash/_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,10 @@ def _infer_path(module_name, template):


def _module_name_is_package(module_name):
file_path = sys.modules[module_name].__file__
return (
file_path
and module_name in sys.modules
and Path(file_path).name == "__init__.py"
)
if module_name not in sys.modules:
return False
file = sys.modules[module_name].__file__
return file and file.endswith("__init__.py")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could this return empty string rather than a boolean?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it's usage is in a condition here:

if _module_name_is_package(CONFIG.name):



def _path_to_module_name(path):
Expand Down
Loading