Skip to content

Commit

Permalink
explain reloader workaround for egg script
Browse files Browse the repository at this point in the history
  • Loading branch information
davidism committed Jul 12, 2019
1 parent 5f42acf commit 7a01660
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/werkzeug/_reloader.py
Expand Up @@ -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)
Expand Down

0 comments on commit 7a01660

Please sign in to comment.