Skip to content
Open
Changes from all 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
6 changes: 3 additions & 3 deletions dash/dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -2061,10 +2061,10 @@ def enable_dev_tools(
_reload = self._hot_reload
_reload.hash = generate_hash()

# find_loader should return None on __main__ but doesn't
# find_spec should return None on __main__ but doesn't
# on some Python versions https://bugs.python.org/issue14710
Comment on lines +2064 to 2065
Copy link
Member Author

@ndrezn ndrezn Oct 10, 2025

Choose a reason for hiding this comment

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

Maybe this comment no longer applies but I'm not sure how to test

Copy link
Contributor

Choose a reason for hiding this comment

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

No the comment is for old python versions not supported anymore.

packages = [
pkgutil.find_loader(x)
find_spec(x)
for x in list(ComponentRegistry.registry)
if x != "__main__"
]
Expand All @@ -2079,7 +2079,7 @@ def enable_dev_tools(

for index, package in enumerate(packages):
if isinstance(package, AssertionRewritingHook):
dash_spec = importlib.util.find_spec("dash") # type: ignore[reportAttributeAccess]
dash_spec = find_spec("dash") # type: ignore[reportAttributeAccess]
dash_test_path = dash_spec.submodule_search_locations[0]
setattr(dash_spec, "path", dash_test_path)
packages[index] = dash_spec
Expand Down