diff --git a/dash/dash.py b/dash/dash.py index 2d5e8f42f1..fae8b960b6 100644 --- a/dash/dash.py +++ b/dash/dash.py @@ -2080,10 +2080,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 packages = [ - pkgutil.find_loader(x) + find_spec(x) for x in list(ComponentRegistry.registry) if x != "__main__" ] @@ -2098,7 +2098,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