From 1a1e46bcd4b72146b27877f26ad85d811ae63894 Mon Sep 17 00:00:00 2001 From: "eli.bendersky" Date: Fri, 18 Feb 2011 15:32:18 +0200 Subject: Removed portability.py, using from __future__ import print_function instead. This means only Python 2.6 and later is supported in 2.x --- examples/func_calls.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'examples/func_calls.py') diff --git a/examples/func_calls.py b/examples/func_calls.py index eaa3a67..4789688 100644 --- a/examples/func_calls.py +++ b/examples/func_calls.py @@ -4,9 +4,10 @@ # Using pycparser for printing out all the calls of some function # in a C file. # -# Copyright (C) 2008, Eli Bendersky +# Copyright (C) 2008-2011, Eli Bendersky # License: LGPL #----------------------------------------------------------------- +from __future__ import print_function import sys # This is not required if you've installed pycparser into @@ -15,7 +16,6 @@ import sys sys.path.insert(0, '..') from pycparser import c_parser, c_ast, parse_file -from pycparser.portability import printme # A visitor with some state information (the funcname it's @@ -27,7 +27,7 @@ class FuncCallVisitor(c_ast.NodeVisitor): def visit_FuncCall(self, node): if node.name.name == self.funcname: - printme('%s called at %s\n' % ( + print('%s called at %s' % ( self.funcname, node.name.coord)) @@ -39,7 +39,7 @@ def show_func_calls(filename, funcname): if __name__ == "__main__": if len(sys.argv) > 2: - filename = sys.argv[1] + filename = sys.argv[1] func = sys.argv[2] else: filename = 'c_files/hash.c' -- cgit v1.2.1