There was an error while loading. Please reload this page.
1 parent 311e7e7 commit d97d139Copy full SHA for d97d139
1 file changed
Lib/test/test_dtrace.py
@@ -1,6 +1,7 @@
1
import dis
2
import os.path
3
import re
4
+import shlex
5
import signal
6
import subprocess
7
import sys
@@ -148,7 +149,7 @@ def trace_python(self, script_file, python_file, optimize_python=None):
148
149
python_flags = []
150
if optimize_python:
151
python_flags.extend(["-O"] * optimize_python)
- subcommand = " ".join([sys.executable] + python_flags + [python_file])
152
+ subcommand = shlex.join([sys.executable] + python_flags + [python_file])
153
return self.trace(script_file, subcommand, timeout=60,
154
check_returncode=True)
155
@@ -276,7 +277,7 @@ def run_case(self, name, optimize_python=None):
276
277
278
try:
279
proc = create_process_group(
- ["bpftrace", "-e", program, "-c", " ".join(subcommand)],
280
+ ["bpftrace", "-e", program, "-c", shlex.join(subcommand)],
281
stdout=subprocess.PIPE,
282
stderr=subprocess.PIPE,
283
universal_newlines=True,
0 commit comments