diff options
author | grizzlynyo <grizzly.nyo@gmail.com> | 2015-11-21 15:15:23 +0200 |
---|---|---|
committer | grizzlynyo <grizzly.nyo@gmail.com> | 2015-11-21 15:15:23 +0200 |
commit | 864de11cf162c693fe248b609d73545cacb622df (patch) | |
tree | 725a87e96d2796cc9cff7d41b175a37f17cd0ed7 /setuptools/command/easy_install.py | |
parent | cff3a4820a926b379b5556ab28c9e5bd67152926 (diff) | |
download | external_python_setuptools-864de11cf162c693fe248b609d73545cacb622df.tar.gz external_python_setuptools-864de11cf162c693fe248b609d73545cacb622df.tar.bz2 external_python_setuptools-864de11cf162c693fe248b609d73545cacb622df.zip |
fix an issue for bdist_wininst with gui_scripts:
The script header was always generated with non-gui executable.
This was caused by by adjust_header assuming the executable is always an
absolute path.
Fixed by using find_executables() from distutils.
--HG--
branch : bdist_wininst_gui_scripts
Diffstat (limited to 'setuptools/command/easy_install.py')
-rwxr-xr-x | setuptools/command/easy_install.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 45d180bb..7ceac03f 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -2137,10 +2137,13 @@ class WindowsScriptWriter(ScriptWriter): pattern, repl = repl, pattern pattern_ob = re.compile(re.escape(pattern), re.IGNORECASE) new_header = pattern_ob.sub(string=orig_header, repl=repl) - clean_header = new_header[2:-1].strip('"') - if sys.platform == 'win32' and not os.path.exists(clean_header): - # the adjusted version doesn't exist, so return the original - return orig_header + if sys.platform == 'win32': + from distutils.spawn import find_executable + + clean_header = new_header[2:-1].strip('"') + if not find_executable(clean_header): + # the adjusted version doesn't exist, so return the original + return orig_header return new_header |