Closed
Description
The _module_name_is_package
function in dash/_pages.py
is used to check whether a name is a package.
In the latest version (bb13521), the _module_name_is_package
function reads
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"
)
This will crash if the module_name
is not in sys.modules.
The original version (74252a8) of this function doesn't have this problem since the sys.modules won't be called if module_name is not in sys.modules.
def _module_name_is_package(module_name):
return (
module_name in sys.modules
and Path(sys.modules[module_name].__file__).name == "__init__.py"
)