[Lldb-commits] [lldb] 162e9f7 - [lldb/Test] Reduce code duplication by importing subprocess globally

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Fri Jul 31 10:56:20 PDT 2020


Author: Jonas Devlieghere
Date: 2020-07-31T10:56:13-07:00
New Revision: 162e9f72ac57342a0ea12036576d6212720cc93f

URL: https://github.com/llvm/llvm-project/commit/162e9f72ac57342a0ea12036576d6212720cc93f
DIFF: https://github.com/llvm/llvm-project/commit/162e9f72ac57342a0ea12036576d6212720cc93f.diff

LOG: [lldb/Test] Reduce code duplication by importing subprocess globally

Import the subprocess module once instead of doing it inline which is
error prone and leads to needless code duplication.

Added: 
    

Modified: 
    lldb/test/API/lit.cfg.py

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/lit.cfg.py b/lldb/test/API/lit.cfg.py
index a211abe6cc41..e083e2fd9beb 100644
--- a/lldb/test/API/lit.cfg.py
+++ b/lldb/test/API/lit.cfg.py
@@ -6,6 +6,7 @@
 import platform
 import shlex
 import shutil
+import subprocess
 
 import lit.formats
 
@@ -33,7 +34,6 @@ def mkdir_p(path):
 
 
 def find_sanitizer_runtime(name):
-  import subprocess
   resource_dir = subprocess.check_output(
       [config.cmake_cxx_compiler,
        '-print-resource-dir']).decode('utf-8').strip()
@@ -60,7 +60,6 @@ def find_python_interpreter():
     return copied_python
 
   # Find the "real" python binary.
-  import shutil, subprocess
   real_python = subprocess.check_output([
       config.python_executable,
       os.path.join(os.path.dirname(os.path.realpath(__file__)),


        


More information about the lldb-commits mailing list