diff options
author | Davide Italiano <davide@freebsd.org> | 2019-04-18 23:24:54 +0000 |
---|---|---|
committer | Davide Italiano <davide@freebsd.org> | 2019-04-18 23:24:54 +0000 |
commit | 185de8eeaaaea1e1300980f04a4479ca7edff4d4 (patch) | |
tree | d637aa1ee57b65c30461091e2885ce34fd1cea9a /lldb/examples/python | |
parent | 7cc87be4bb99b23dc4813bff653dc86fb4e6c7f6 (diff) | |
download | bcm5719-llvm-185de8eeaaaea1e1300980f04a4479ca7edff4d4.tar.gz bcm5719-llvm-185de8eeaaaea1e1300980f04a4479ca7edff4d4.zip |
[Python] Simplify the code. NFCI.
llvm-svn: 358721
Diffstat (limited to 'lldb/examples/python')
-rwxr-xr-x | lldb/examples/python/memory.py | 8 | ||||
-rwxr-xr-x | lldb/examples/python/performance.py | 8 | ||||
-rwxr-xr-x | lldb/examples/python/process_events.py | 8 | ||||
-rwxr-xr-x | lldb/examples/python/types.py | 8 |
4 files changed, 8 insertions, 24 deletions
diff --git a/lldb/examples/python/memory.py b/lldb/examples/python/memory.py index d2bc60cb10f..9f8f7e384c4 100755 --- a/lldb/examples/python/memory.py +++ b/lldb/examples/python/memory.py @@ -15,11 +15,7 @@ import platform import os import re import sys - -if sys.version_info.major == 2: - import commands as subprocess -else: - import subprocess +import subprocess try: # Just try for LLDB in case PYTHONPATH is already correctly setup @@ -30,7 +26,7 @@ except ImportError: platform_system = platform.system() if platform_system == 'Darwin': # On Darwin, try the currently selected Xcode directory - xcode_dir = subprocess.getoutput("xcode-select --print-path") + xcode_dir = subprocess.check_output("xcode-select --print-path", shell=True) if xcode_dir: lldb_python_dirs.append( os.path.realpath( diff --git a/lldb/examples/python/performance.py b/lldb/examples/python/performance.py index 9a514e74b7c..aec6b307f87 100755 --- a/lldb/examples/python/performance.py +++ b/lldb/examples/python/performance.py @@ -16,14 +16,10 @@ import platform import re import resource import sys +import subprocess import time import types -if sys.version_info.major == 2: - import commands as subprocess -else: - import subprocess - #---------------------------------------------------------------------- # Code that auto imports LLDB #---------------------------------------------------------------------- @@ -36,7 +32,7 @@ except ImportError: platform_system = platform.system() if platform_system == 'Darwin': # On Darwin, try the currently selected Xcode directory - xcode_dir = subprocess.getoutput("xcode-select --print-path") + xcode_dir = subprocess.check_output("xcode-select --print-path", shell=True) if xcode_dir: lldb_python_dirs.append( os.path.realpath( diff --git a/lldb/examples/python/process_events.py b/lldb/examples/python/process_events.py index 9fd1347176d..6039ebf0020 100755 --- a/lldb/examples/python/process_events.py +++ b/lldb/examples/python/process_events.py @@ -14,11 +14,7 @@ import optparse import os import platform import sys - -if sys.version_info.major == 2: - import commands as subprocess -else: - import subprocess +import subprocess #---------------------------------------------------------------------- # Code that auto imports LLDB @@ -32,7 +28,7 @@ except ImportError: platform_system = platform.system() if platform_system == 'Darwin': # On Darwin, try the currently selected Xcode directory - xcode_dir = subprocess.getoutput("xcode-select --print-path") + xcode_dir = subprocess.check_output("xcode-select --print-path", shell=True) if xcode_dir: lldb_python_dirs.append( os.path.realpath( diff --git a/lldb/examples/python/types.py b/lldb/examples/python/types.py index 9613197db1d..a401e373f48 100755 --- a/lldb/examples/python/types.py +++ b/lldb/examples/python/types.py @@ -16,11 +16,7 @@ import os import re import signal import sys - -if sys.version_info.major == 2: - import commands as subprocess -else: - import subprocess +import subprocess try: # Just try for LLDB in case PYTHONPATH is already correctly setup @@ -31,7 +27,7 @@ except ImportError: platform_system = platform.system() if platform_system == 'Darwin': # On Darwin, try the currently selected Xcode directory - xcode_dir = subprocess.getoutput("xcode-select --print-path") + xcode_dir = subprocess.check_output("xcode-select --print-path", shell=True) if xcode_dir: lldb_python_dirs.append( os.path.realpath( |