Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions lldb/packages/Python/lldbsuite/support/seven.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import binascii
import shlex
import subprocess


Expand Down Expand Up @@ -38,8 +37,3 @@ def unhexlify(hexstr):
def hexlify(data):
"""Hex-encode string data. The result if always a string."""
return bitcast_to_string(binascii.hexlify(bitcast_to_bytes(data)))


# TODO: Replace this with `shlex.join` when minimum Python version is >= 3.8
def join_for_shell(split_command):
return " ".join([shlex.quote(part) for part in split_command])
4 changes: 2 additions & 2 deletions lldb/packages/Python/lldbsuite/test/lldbtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import os.path
import re
import shutil
import shlex
import signal
from subprocess import *
import sys
Expand All @@ -56,7 +57,6 @@
from . import test_categories
from lldbsuite.support import encoded_file
from lldbsuite.support import funcutils
from lldbsuite.support import seven
from lldbsuite.test_event import build_exception

# See also dotest.parseOptionsAndInitTestdirs(), where the environment variables
Expand Down Expand Up @@ -1508,7 +1508,7 @@ def build(
self.runBuildCommand(command)

def runBuildCommand(self, command):
self.trace(seven.join_for_shell(command))
self.trace(shlex.join(command))
try:
output = check_output(command, stderr=STDOUT, errors="replace")
except CalledProcessError as cpe:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from lldbsuite.support import seven
import shlex


class BuildError(Exception):
def __init__(self, called_process_error):
super(BuildError, self).__init__("Error when building test subject")
self.command = seven.join_for_shell(called_process_error.cmd)
self.command = shlex.join(called_process_error.cmd)
self.build_error = called_process_error.output

def __str__(self):
Expand Down
1 change: 1 addition & 0 deletions lldb/test/API/tools/lldb-server/TestGdbRemoteFork.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.support import seven

from fork_testbase import GdbRemoteForkTestBase

Expand Down
Loading