summaryrefslogtreecommitdiffstats
path: root/tools/debugscripts
diff options
context:
space:
mode:
authorrodrigc <rodrigc@FreeBSD.org>2015-11-19 00:01:52 +0000
committerrodrigc <rodrigc@FreeBSD.org>2015-11-19 00:01:52 +0000
commitb75981aabc20f749744f5b8ca7e596ce3f276154 (patch)
treeac0a298319445487c327ba5ef036a39c5cc7318f /tools/debugscripts
parent6ae0b4f9be2b79ffde9848f96e414b5dcff599ad (diff)
downloadFreeBSD-src-b75981aabc20f749744f5b8ca7e596ce3f276154.zip
FreeBSD-src-b75981aabc20f749744f5b8ca7e596ce3f276154.tar.gz
Use print as a function for Python 3 [PEP 3105]
Import print_function from the __future__ module to activate this for Python 2. This works as far back as Python 2.6.0a2: https://docs.python.org/2/library/__future__.html [PEP 3105] https://www.python.org/dev/peps/pep-3105/
Diffstat (limited to 'tools/debugscripts')
-rw-r--r--tools/debugscripts/kld_deb.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/debugscripts/kld_deb.py b/tools/debugscripts/kld_deb.py
index 5cf0167..167b3dc 100644
--- a/tools/debugscripts/kld_deb.py
+++ b/tools/debugscripts/kld_deb.py
@@ -26,6 +26,7 @@
#
# $FreeBSD$
+from __future__ import print_function
import sys
import os
import popen2
@@ -42,7 +43,7 @@ printre = re.compile(r'\$\d+\s+=\s+')
kld_debug_paths = []
if len(sys.argv[1:]) < 2:
- print 'Usage: prog <kerncomp> <core> [<paths>]'
+ print('Usage: prog <kerncomp> <core> [<paths>]')
sys.exit(1)
#Get the base modules path
@@ -129,7 +130,7 @@ for i in addr[1:]:
#Tell our user that we couldn't find it.
a = i[1]
sys.stderr.write("Can't find module: %s (addr: %d + header)\n" % (i[0], a))
- print '#add-symbol-file <file>', a, '#add header'
+ print('#add-symbol-file <file>', a, '#add header')
continue
#j = popen2.popen4('objdump --section-headers /boot/kernel/%s | grep "\.text"' % i[0])[0].read().strip().split()
@@ -137,6 +138,6 @@ for i in addr[1:]:
j = popen2.popen4('objdump --section-headers "%s" | grep "\.text"' % p)[0].read().strip().split()
try:
a = int(j[5], 16)
- print 'add-symbol-file', p, i[1] + a
+ print('add-symbol-file', p, i[1] + a)
except IndexError:
sys.stderr.write('Bad file: %s, address: %d\n' % (i[0], i[1]))
OpenPOWER on IntegriCloud