summaryrefslogtreecommitdiff
path: root/examples/func_calls.py
diff options
context:
space:
mode:
authoreli.bendersky <devnull@localhost>2011-02-18 15:32:18 +0200
committereli.bendersky <devnull@localhost>2011-02-18 15:32:18 +0200
commit1a1e46bcd4b72146b27877f26ad85d811ae63894 (patch)
tree9e9de12432d8b57d0fba9f71d0ab2bcccd216486 /examples/func_calls.py
parent92b72024648f5bbbabda9d29276e4ce7bcace763 (diff)
downloadpycparser-1a1e46bcd4b72146b27877f26ad85d811ae63894.tar.gz
Removed portability.py, using from __future__ import print_function instead. This means only Python 2.6 and later is supported in 2.x
Diffstat (limited to 'examples/func_calls.py')
-rw-r--r--examples/func_calls.py8
1 files changed, 4 insertions, 4 deletions
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'