File tree Expand file tree Collapse file tree 4 files changed +5
-10
lines changed
packages/Python/lldbsuite
test/API/tools/lldb-server Expand file tree Collapse file tree 4 files changed +5
-10
lines changed Original file line number Diff line number Diff line change 11import binascii
2- import shlex
32import subprocess
43
54
@@ -38,8 +37,3 @@ def unhexlify(hexstr):
3837def hexlify (data ):
3938 """Hex-encode string data. The result if always a string."""
4039 return bitcast_to_string (binascii .hexlify (bitcast_to_bytes (data )))
41-
42-
43- # TODO: Replace this with `shlex.join` when minimum Python version is >= 3.8
44- def join_for_shell (split_command ):
45- return " " .join ([shlex .quote (part ) for part in split_command ])
Original file line number Diff line number Diff line change 3636import os .path
3737import re
3838import shutil
39+ import shlex
3940import signal
4041from subprocess import *
4142import sys
5657from . import test_categories
5758from lldbsuite .support import encoded_file
5859from lldbsuite .support import funcutils
59- from lldbsuite .support import seven
6060from lldbsuite .test_event import build_exception
6161
6262# See also dotest.parseOptionsAndInitTestdirs(), where the environment variables
@@ -1508,7 +1508,7 @@ def build(
15081508 self .runBuildCommand (command )
15091509
15101510 def runBuildCommand (self , command ):
1511- self .trace (seven . join_for_shell (command ))
1511+ self .trace (shlex . join (command ))
15121512 try :
15131513 output = check_output (command , stderr = STDOUT , errors = "replace" )
15141514 except CalledProcessError as cpe :
Original file line number Diff line number Diff line change 1- from lldbsuite . support import seven
1+ import shlex
22
33
44class BuildError (Exception ):
55 def __init__ (self , called_process_error ):
66 super (BuildError , self ).__init__ ("Error when building test subject" )
7- self .command = seven . join_for_shell (called_process_error .cmd )
7+ self .command = shlex . join (called_process_error .cmd )
88 self .build_error = called_process_error .output
99
1010 def __str__ (self ):
Original file line number Diff line number Diff line change 22
33from lldbsuite .test .decorators import *
44from lldbsuite .test .lldbtest import *
5+ from lldbsuite .support import seven
56
67from fork_testbase import GdbRemoteForkTestBase
78
You can’t perform that action at this time.
0 commit comments