aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command/easy_install.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2015-01-04 15:35:24 -0500
committerJason R. Coombs <jaraco@jaraco.com>2015-01-04 15:35:24 -0500
commit76dd319a776b3fb7bc7836eb18429ab407379ea9 (patch)
tree235e66ff05c691a8d99d5343fe878e133c72cbe7 /setuptools/command/easy_install.py
parent371c355c4f8b406e0390bf964bb4d7f4266ba3e8 (diff)
downloadexternal_python_setuptools-76dd319a776b3fb7bc7836eb18429ab407379ea9.tar.gz
external_python_setuptools-76dd319a776b3fb7bc7836eb18429ab407379ea9.tar.bz2
external_python_setuptools-76dd319a776b3fb7bc7836eb18429ab407379ea9.zip
Reuse list2cmdline for argument quoting.
Diffstat (limited to 'setuptools/command/easy_install.py')
-rwxr-xr-xsetuptools/command/easy_install.py32
1 files changed, 2 insertions, 30 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index d05f4c65..c68fe757 100755
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -35,6 +35,7 @@ import warnings
import site
import struct
import contextlib
+import subprocess
from setuptools import Command
from setuptools.sandbox import run_setup
@@ -1825,36 +1826,7 @@ def is_sh(executable):
def nt_quote_arg(arg):
"""Quote a command line argument according to Windows parsing rules"""
-
- result = []
- needquote = False
- nb = 0
-
- needquote = (" " in arg) or ("\t" in arg)
- if needquote:
- result.append('"')
-
- for c in arg:
- if c == '\\':
- nb += 1
- elif c == '"':
- # double preceding backslashes, then add a \"
- result.append('\\' * (nb * 2) + '\\"')
- nb = 0
- else:
- if nb:
- result.append('\\' * nb)
- nb = 0
- result.append(c)
-
- if nb:
- result.append('\\' * nb)
-
- if needquote:
- result.append('\\' * nb) # double the trailing backslashes
- result.append('"')
-
- return ''.join(result)
+ return subprocess.list2cmdline([arg])
def is_python_script(script_text, filename):