diff options
author | Paul McGuire <ptmcg@austin.rr.com> | 2012-11-23 08:54:10 +0000 |
---|---|---|
committer | Paul McGuire <ptmcg@austin.rr.com> | 2012-11-23 08:54:10 +0000 |
commit | 774e46526945ea91265734a2dc82d15eed515577 (patch) | |
tree | 734ae210c20a98f01fe029f7e6eeb7a93b4617fb /src/examples/idlParse.py | |
parent | 6b12041d4656f4cda910f24acda8d71013166fbd (diff) | |
download | pyparsing-git-774e46526945ea91265734a2dc82d15eed515577.tar.gz |
Clean up examples to be Python 3 compatible
Diffstat (limited to 'src/examples/idlParse.py')
-rw-r--r-- | src/examples/idlParse.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/examples/idlParse.py b/src/examples/idlParse.py index c1d5e4f..419e56f 100644 --- a/src/examples/idlParse.py +++ b/src/examples/idlParse.py @@ -119,20 +119,20 @@ def CORBA_IDL_BNF(): testnum = 1
def test( strng ):
global testnum
- print strng
+ print(strng)
try:
bnf = CORBA_IDL_BNF()
tokens = bnf.parseString( strng )
- print "tokens = "
+ print("tokens = ")
pprint.pprint( tokens.asList() )
imgname = "idlParse%02d.bmp" % testnum
testnum += 1
#~ tree2image.str2image( str(tokens.asList()), imgname )
- except ParseException, err:
- print err.line
- print " "*(err.column-1) + "^"
- print err
- print
+ except ParseException as err:
+ print(err.line)
+ print(" "*(err.column-1) + "^")
+ print(err)
+ print()
if __name__ == "__main__":
test(
|