From 7a01660d54e3c74cf1f6e862feac07c89c30602f Mon Sep 17 00:00:00 2001 From: David Lord Date: Fri, 12 Jul 2019 13:26:36 -0700 Subject: [PATCH] explain reloader workaround for egg script --- CHANGES.rst | 2 ++ src/werkzeug/_reloader.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index ada5e43d9..846c4f291 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -16,6 +16,8 @@ Unreleased :pr:`1592` - Work around an issue in some external debuggers that caused the reloader to fail. :issue:`1607` +- Work around an issue where the reloader couldn't introspect a + setuptools script installed as an egg. :issue:`1600` Version 0.15.4 diff --git a/src/werkzeug/_reloader.py b/src/werkzeug/_reloader.py index 49f916f98..f085d44a2 100644 --- a/src/werkzeug/_reloader.py +++ b/src/werkzeug/_reloader.py @@ -73,6 +73,8 @@ def _get_args_for_reloading(): # Need to look at main module to determine how it was executed. __main__ = sys.modules["__main__"] + # The value of __package__ indicates how Python was called. It may + # not exist if a setuptools script is installed as an egg. if getattr(__main__, "__package__", None) is None: # Executed a file, like "python app.py". py_script = os.path.abspath(py_script)