File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -97,6 +97,9 @@ Unreleased
9797 by setting ``e.args = () ``. (`#1395 `_)
9898- Add support for status code 424 :exc: `~exceptions.FailedDependency `.
9999 (`#1358 `_)
100+ - The reloader will not prepend the Python executable to the command
101+ line if the Python file is marked executable. This allows the
102+ reloader to work on NixOS. (`#1242 `_)
100103
101104.. _`#209` : https://github.com/pallets/werkzeug/pull/209
102105.. _`#609` : https://github.com/pallets/werkzeug/pull/609
@@ -112,6 +115,7 @@ Unreleased
112115.. _`#1231` : https://github.com/pallets/werkzeug/issues/1231
113116.. _`#1233` : https://github.com/pallets/werkzeug/pull/1233
114117.. _`#1237` : https://github.com/pallets/werkzeug/pull/1237
118+ .. _`#1242` : https://github.com/pallets/werkzeug/pull/1242
115119.. _`#1245` : https://github.com/pallets/werkzeug/pull/1245
116120.. _`#1249` : https://github.com/pallets/werkzeug/issues/1249
117121.. _`#1252` : https://github.com/pallets/werkzeug/pull/1252
Original file line number Diff line number Diff line change @@ -65,16 +65,20 @@ def _get_args_for_reloading():
6565 """
6666 rv = [sys .executable ]
6767 py_script = sys .argv [0 ]
68+
6869 if os .name == 'nt' and not os .path .exists (py_script ) and \
6970 os .path .exists (py_script + '.exe' ):
7071 py_script += '.exe'
7172
72- windows_workaround = (os .path .splitext (rv [0 ])[1 ] == '.exe' and
73- os .path .splitext (py_script )[1 ] == '.exe' )
74- nix_workaround = (os .path .isfile (py_script ) and
75- os .access (py_script , os .X_OK ))
73+ windows_workaround = (
74+ os .path .splitext (rv [0 ])[1 ] == '.exe'
75+ and os .path .splitext (py_script )[1 ] == '.exe'
76+ )
77+ nix_workaround = os .path .isfile (py_script ) and os .access (py_script , os .X_OK )
78+
7679 if windows_workaround or nix_workaround :
7780 rv .pop (0 )
81+
7882 rv .append (py_script )
7983 rv .extend (sys .argv [1 :])
8084 return rv
You can’t perform that action at this time.
0 commit comments