diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2015-11-27 21:27:48 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2015-11-27 21:27:48 -0500 |
commit | 19a5291393810771f5f2b1dd27c213e35b75f30b (patch) | |
tree | f3cb692bcb48bd5762a5df54570b29f9485177b2 /setuptools/command/easy_install.py | |
parent | aa8a6c90ac9b165ee1c6e6e3d72fff34adba2850 (diff) | |
parent | 864de11cf162c693fe248b609d73545cacb622df (diff) | |
download | external_python_setuptools-19a5291393810771f5f2b1dd27c213e35b75f30b.tar.gz external_python_setuptools-19a5291393810771f5f2b1dd27c213e35b75f30b.tar.bz2 external_python_setuptools-19a5291393810771f5f2b1dd27c213e35b75f30b.zip |
Merged in grizzlynyo/setuptools/bdist_wininst_gui_scripts (pull request #160)
fix an issue for bdist_wininst with 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 4fae2560..f3b5fa62 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -2138,10 +2138,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 |