summaryrefslogtreecommitdiffstats
path: root/lldb/examples/python/process_events.py
diff options
context:
space:
mode:
authorSerge Guelton <sguelton@redhat.com>2019-03-26 14:46:15 +0000
committerSerge Guelton <sguelton@redhat.com>2019-03-26 14:46:15 +0000
commit1a12dd70c00a44e34384b1904d18d309ae3c3ac6 (patch)
treefd786218bf2e1d8894562c909de7b30f08608f02 /lldb/examples/python/process_events.py
parent25f9094d89d01d4fb562ba0edcc2eb63f9e074d7 (diff)
downloadbcm5719-llvm-1a12dd70c00a44e34384b1904d18d309ae3c3ac6.tar.gz
bcm5719-llvm-1a12dd70c00a44e34384b1904d18d309ae3c3ac6.zip
python 2/3 compat: commands vs subprocess
Differential Revision: https://reviews.llvm.org/D59584 llvm-svn: 356995
Diffstat (limited to 'lldb/examples/python/process_events.py')
-rwxr-xr-xlldb/examples/python/process_events.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/lldb/examples/python/process_events.py b/lldb/examples/python/process_events.py
index a00217b70c8..9fd1347176d 100755
--- a/lldb/examples/python/process_events.py
+++ b/lldb/examples/python/process_events.py
@@ -8,7 +8,6 @@
# export PYTHONPATH=/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Resources/Python
#----------------------------------------------------------------------
-import commands
from __future__ import print_function
import optparse
@@ -16,6 +15,11 @@ import os
import platform
import sys
+if sys.version_info.major == 2:
+ import commands as subprocess
+else:
+ import subprocess
+
#----------------------------------------------------------------------
# Code that auto imports LLDB
#----------------------------------------------------------------------
@@ -28,7 +32,7 @@ except ImportError:
platform_system = platform.system()
if platform_system == 'Darwin':
# On Darwin, try the currently selected Xcode directory
- xcode_dir = commands.getoutput("xcode-select --print-path")
+ xcode_dir = subprocess.getoutput("xcode-select --print-path")
if xcode_dir:
lldb_python_dirs.append(
os.path.realpath(
OpenPOWER on IntegriCloud