Skip to content

Commit 310f732

Browse files
committed
Fixed parse.py to be Python 3-compatible
1 parent ca289c3 commit 310f732

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

parse.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import print_function
2+
13
import sys
24
import glob
35
import os
@@ -20,7 +22,7 @@ def parse_fortran_template(input,output):
2022

2123
# Read input file
2224

23-
program = open(input, "rb")
25+
program = open(input, "r")
2426
lines = program.readlines()
2527
program.close()
2628

@@ -34,7 +36,7 @@ def parse_fortran_template(input,output):
3436
except:
3537
break
3638

37-
print " Block found from lines "+str(istart)+" to "+str(iend)
39+
print(" Block found from lines "+str(istart)+" to "+str(iend))
3840

3941
types = lines[istart].strip().rsplit()
4042

@@ -63,5 +65,5 @@ def parse_fortran_template(input,output):
6365

6466

6567
for program in glob.glob(os.path.join('templates/','*_template.f90')):
66-
print "Processing %s" % program
68+
print("Processing %s" % program)
6769
parse_fortran_template(program, program.replace('_template.f90','.f90').replace('templates','src'))

0 commit comments

Comments
 (0)