summaryrefslogtreecommitdiffstats
path: root/lldb/examples/python/delta.py
diff options
context:
space:
mode:
authorSerge Guelton <sguelton@redhat.com>2019-03-21 18:27:40 +0000
committerSerge Guelton <sguelton@redhat.com>2019-03-21 18:27:40 +0000
commit525cd59f5a12254e80d5f20bf2d9713728a114d4 (patch)
treebb174d21b449a016712aa1867fdbdff781b34b15 /lldb/examples/python/delta.py
parent05ea3a6be3ba172e8824a8fb66b799b3cc2c72f3 (diff)
downloadbcm5719-llvm-525cd59f5a12254e80d5f20bf2d9713728a114d4.tar.gz
bcm5719-llvm-525cd59f5a12254e80d5f20bf2d9713728a114d4.zip
Python 2/3 compatibility: from __future__ import print_function
Differential Revision: https://reviews.llvm.org/D59580 llvm-svn: 356695
Diffstat (limited to 'lldb/examples/python/delta.py')
-rwxr-xr-xlldb/examples/python/delta.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/lldb/examples/python/delta.py b/lldb/examples/python/delta.py
index 1b192aceb9d..bb52cad633f 100755
--- a/lldb/examples/python/delta.py
+++ b/lldb/examples/python/delta.py
@@ -17,6 +17,8 @@
#----------------------------------------------------------------------
import commands
+from __future__ import print_function
+
import optparse
import os
import shlex
@@ -94,9 +96,9 @@ def parse_log_file(file, options):
handy when trying to figure out why some operation in the debugger is taking
a long time during a preset set of debugger commands.'''
- print '#----------------------------------------------------------------------'
- print "# Log file: '%s'" % file
- print '#----------------------------------------------------------------------'
+ print('#----------------------------------------------------------------------')
+ print("# Log file: '%s'" % file)
+ print('#----------------------------------------------------------------------')
timestamp_regex = re.compile('(\s*)([1-9][0-9]+\.[0-9]+)([^0-9].*)$')
@@ -114,10 +116,10 @@ def parse_log_file(file, options):
else:
base_time = curr_time
- print '%s%.6f %+.6f%s' % (match.group(1), curr_time - base_time, delta, match.group(3))
+ print('%s%.6f %+.6f%s' % (match.group(1), curr_time - base_time, delta, match.group(3)))
last_time = curr_time
else:
- print line
+ print(line)
if __name__ == '__main__':
@@ -131,4 +133,4 @@ else:
# Add any commands contained in this module to LLDB
lldb.debugger.HandleCommand(
'command script add -f delta.parse_time_log parse_time_log')
- print 'The "parse_time_log" command is now installed and ready for use, type "parse_time_log --help" for more information'
+ print('The "parse_time_log" command is now installed and ready for use, type "parse_time_log --help" for more information')
OpenPOWER on IntegriCloud