File tree Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change 14
14
except ImportError : # pragma: no cover
15
15
from urllib import urlencode
16
16
17
8000
code>
- try :
18
- from shlex import quote
19
- except ImportError : # pragma: no cover
20
- from pipes import quote
17
+ quote = None
18
+ if sys .platform == 'win32' : # pragma: no cover
19
+ try :
20
+ # https://github.com/python/cpython/blob/3.7/Lib/subprocess.py#L174-L175
21
+ from subprocess import list2cmdline
22
+
23
+ def quote (arg ):
24
+ return list2cmdline ([arg ])
25
+ except ImportError :
26
+ pass
27
+
28
+ if quote is None :
29
+ try :
30
+ from shlex import quote
31
+ except ImportError : # pragma: no cover
32
+ from pipes import quote
21
33
22
34
import subprocess
23
35
@@ -181,7 +193,7 @@ def try_to_run(cmd, shell=True):
181
193
182
194
def run_python_coverage (args ):
183
195
"""Run the Python coverage tool
184
-
196
+
185
197
If it's importable in this Python, launch it using 'python -m'.
186
198
Otherwise, look it up on PATH like any other command.
187
199
"""
You can’t perform that action at this time.
0 commit comments