From 749f65e3e30e857301e44db4a87eca99d45cdc66 Mon Sep 17 00:00:00 2001 From: Craig Rodrigues Date: Thu, 19 Nov 2015 00:01:52 +0000 Subject: 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/ --- tools/debugscripts/kld_deb.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tools/debugscripts') diff --git a/tools/debugscripts/kld_deb.py b/tools/debugscripts/kld_deb.py index 5cf016746c42..167b3dc17b9c 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 []' + print('Usage: prog []') 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 ', a, '#add header' + print('#add-symbol-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])) -- cgit v1.3