summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsetuptools/command/easy_install.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index b1838024..f82125d6 100755
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -1862,8 +1862,8 @@ class WindowsScriptWriter(ScriptWriter):
repl = 'python.exe'
if type_ == 'gui':
pattern, repl = repl, pattern
- new_header = re.sub(string=orig_header, pattern=re.escape(pattern),
- repl=repl, flags=re.IGNORECASE)
+ 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