Skip to content

Commit

Permalink
support reloading egg script
Browse files Browse the repository at this point in the history
__main__.__package__ may not exist when installed as an egg
  • Loading branch information
pokoli authored and davidism committed Jul 12, 2019
1 parent 978255d commit 5f42acf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/werkzeug/_reloader.py
Expand Up @@ -73,7 +73,7 @@ def _get_args_for_reloading():
# Need to look at main module to determine how it was executed.
__main__ = sys.modules["__main__"]

if __main__.__package__ is None:
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 5f42acf

Please sign in to comment.