summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsetuptools/command/easy_install.py11
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