summaryrefslogtreecommitdiffstats
path: root/lldb/examples/python/process_events.py
diff options
context:
space:
mode:
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