diff --git a/CHANGELOG.md b/CHANGELOG.md index b5bd28ee4b..5a197a119f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - [#1249](https://github.com/plotly/dash/pull/1249) Fixes [#919](https://github.com/plotly/dash/issues/919) so `dash.testing` is compatible with more `pytest` plugins, particularly `pytest-flake8` and `pytest-black`. - [#1248](https://github.com/plotly/dash/pull/1248) Fixes [#1245](https://github.com/plotly/dash/issues/1245), so you can use prop persistence with components that have dict IDs, ie for pattern-matching callbacks. - [#1185](https://github.com/plotly/dash/pull/1185) Sort asset directories, same as we sort files inside those directories. This way if you need your assets loaded in a certain order, you can add prefixes to subdirectory names and enforce that order. +- [#1288](https://github.com/plotly/dash/pull/1288) Closes [#1285](https://github.com/plotly/dash/issues/1285): Debug=True should work in the __main__ module. ## [1.12.0] - 2020-05-05 ### Added diff --git a/dash/dash.py b/dash/dash.py index 9da6233840..3367e1d236 100644 --- a/dash/dash.py +++ b/dash/dash.py @@ -1338,14 +1338,19 @@ def enable_dev_tools( _reload = self._hot_reload _reload.hash = generate_hash() + # find_loader should return None on __main__ but doesn't + # on some python versions https://bugs.python.org/issue14710 + packages = [ + pkgutil.find_loader(x) + for x in list(ComponentRegistry.registry) + ["dash_renderer"] + if x != "__main__" + ] + component_packages_dist = [ os.path.dirname(package.path) if hasattr(package, "path") else package.filename - for package in ( - pkgutil.find_loader(x) - for x in list(ComponentRegistry.registry) + ["dash_renderer"] - ) + for package in packages ] _reload.watch_thread = threading.Thread(