(s, strip_quotes=False)
| 383 | |
| 384 | def _make_python_cmdline(self, exe, *args): |
| 385 | def normalize(s, strip_quotes=False): |
| 386 | # Convert py.path.local to string |
| 387 | if isinstance(s, py.path.local): |
| 388 | s = s.strpath |
| 389 | else: |
| 390 | s = str(s) |
| 391 | # Strip surrounding quotes if requested |
| 392 | if strip_quotes and len(s) >= 2 and " " in s and (s[0] == s[-1] == '"' or s[0] == s[-1] == "'"): |
| 393 | s = s[1:-1] |
| 394 | return s |
| 395 | |
| 396 | # Strip quotes from exe |
| 397 | result = [normalize(exe, strip_quotes=True)] |