summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/embedded_interpreter.py
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2015-10-16 17:52:32 +0000
committerZachary Turner <zturner@google.com>2015-10-16 17:52:32 +0000
commit5f3fd800f7f2cad6d6519c3ec54cce1324ed1e14 (patch)
tree0b458d4a13453b68c5a4b2e0f583ff48d254acce /lldb/source/Interpreter/embedded_interpreter.py
parent5c3a198266bc2b705761a6dea8754c955ffce075 (diff)
downloadbcm5719-llvm-5f3fd800f7f2cad6d6519c3ec54cce1324ed1e14.tar.gz
bcm5719-llvm-5f3fd800f7f2cad6d6519c3ec54cce1324ed1e14.zip
Make some more of the LLDB/SWIG/Python glue Python 3 aware.
Mostly this is just converting some print statements to print functions. llvm-svn: 250533
Diffstat (limited to 'lldb/source/Interpreter/embedded_interpreter.py')
-rw-r--r--lldb/source/Interpreter/embedded_interpreter.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/lldb/source/Interpreter/embedded_interpreter.py b/lldb/source/Interpreter/embedded_interpreter.py
index 10186f5a9d5..8ba539a2b0c 100644
--- a/lldb/source/Interpreter/embedded_interpreter.py
+++ b/lldb/source/Interpreter/embedded_interpreter.py
@@ -1,7 +1,10 @@
-import __builtin__
+import sys
+if sys.version_info[0] < 3:
+ import __builtin__ as builtins
+else:
+ import builtins
import code
import lldb
-import sys
import traceback
try:
@@ -42,8 +45,8 @@ def setquit():
# "sys.exit(123)"
global g_builtin_override_called
g_builtin_override_called = False
- __builtin__.quit = LLDBQuitter('quit')
- __builtin__.exit = LLDBQuitter('exit')
+ builtins.quit = LLDBQuitter('quit')
+ builtins.exit = LLDBQuitter('exit')
# When running one line, we might place the string to run in this string
# in case it would be hard to correctly escape a string's contents
@@ -94,7 +97,7 @@ def run_python_interpreter (local_dict):
except SystemExit as e:
global g_builtin_override_called
if not g_builtin_override_called:
- print 'Script exited with %s' %(e)
+ print('Script exited with %s' %(e))
def run_one_line (local_dict, input_string):
global g_run_one_line_str
@@ -109,4 +112,4 @@ def run_one_line (local_dict, input_string):
except SystemExit as e:
global g_builtin_override_called
if not g_builtin_override_called:
- print 'Script exited with %s' %(e)
+ print('Script exited with %s' %(e))
OpenPOWER on IntegriCloud