From 8dc3da5cc9908f9e7efe68ac43ec10bc0e7ec22f Mon Sep 17 00:00:00 2001 From: Nathan Drezner Date: Fri, 10 Oct 2025 11:18:44 -0400 Subject: [PATCH 1/2] Remove use of pkgutil.find_loader --- dash/dash.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dash/dash.py b/dash/dash.py index 676fa0f8f4..16e671c4d7 100644 --- a/dash/dash.py +++ b/dash/dash.py @@ -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 packages = [ - pkgutil.find_loader(x) + find_spec(x) for x in list(ComponentRegistry.registry) if x != "__main__" ] From 338aa6d2eb6c4b5eeb1c84d40d20f3a0c3ff0d37 Mon Sep 17 00:00:00 2001 From: Nathan Drezner Date: Fri, 10 Oct 2025 11:20:33 -0400 Subject: [PATCH 2/2] Remove complete reference --- dash/dash.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dash/dash.py b/dash/dash.py index 16e671c4d7..cf307abe03 100644 --- a/dash/dash.py +++ b/dash/dash.py @@ -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