From 71e32aca46d122c801a7db58a0d84d387fa80b29 Mon Sep 17 00:00:00 2001 From: Michal Gorny Date: Tue, 30 Jul 2019 07:47:16 +0000 Subject: [PATCH] [lldb] [test/lldb-vscode] Use os.path.dirname() [NFC] Replace os.path.split()[0] with os.path.dirname(). Suggested by Pavel Labath in D65432. llvm-svn: 367290 --- .../test/tools/lldb-vscode/launch/TestVSCode_launch.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py index 5c996fbee45c..16d8557be2e4 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py @@ -68,7 +68,7 @@ class TestVSCode_launch(lldbvscode_testcase.VSCodeTestCaseBase): directory. ''' program = self.getBuildArtifact("a.out") - program_parent_dir = os.path.split(os.path.split(program)[0])[0] + program_parent_dir = os.path.dirname(os.path.dirname(program)) self.build_and_launch(program, cwd=program_parent_dir) self.continue_to_exit() @@ -96,7 +96,7 @@ class TestVSCode_launch(lldbvscode_testcase.VSCodeTestCaseBase): the lldb-vscode debug adaptor. ''' program = self.getBuildArtifact("a.out") - program_parent_dir = os.path.split(os.path.split(program)[0])[0] + program_parent_dir = os.path.dirname(os.path.dirname(program)) commands = ['platform shell echo cwd = $PWD'] self.build_and_launch(program, debuggerRoot=program_parent_dir, @@ -124,7 +124,7 @@ class TestVSCode_launch(lldbvscode_testcase.VSCodeTestCaseBase): Tests the "sourcePath" will set the target.source-map. ''' program = self.getBuildArtifact("a.out") - program_dir = os.path.split(program)[0] + program_dir = os.path.dirname(program) self.build_and_launch(program, sourcePath=program_dir) output = self.get_console() @@ -170,7 +170,7 @@ class TestVSCode_launch(lldbvscode_testcase.VSCodeTestCaseBase): enabled. ''' program = self.getBuildArtifact("a.out") - program_dir = os.path.split(program)[0] + program_dir = os.path.dirname(program) glob = os.path.join(program_dir, '*.out') self.build_and_launch(program, args=[glob], shellExpandArguments=True) self.continue_to_exit() @@ -195,7 +195,7 @@ class TestVSCode_launch(lldbvscode_testcase.VSCodeTestCaseBase): disabled. ''' program = self.getBuildArtifact("a.out") - program_dir = os.path.split(program)[0] + program_dir = os.path.dirname(program) glob = os.path.join(program_dir, '*.out') self.build_and_launch(program, args=[glob],