summaryrefslogtreecommitdiffstats
path: root/test/Fortran/FORTRANPPFILESUFFIXES.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/Fortran/FORTRANPPFILESUFFIXES.py')
-rw-r--r--test/Fortran/FORTRANPPFILESUFFIXES.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/Fortran/FORTRANPPFILESUFFIXES.py b/test/Fortran/FORTRANPPFILESUFFIXES.py
index 2791b91..6b3b3d8 100644
--- a/test/Fortran/FORTRANPPFILESUFFIXES.py
+++ b/test/Fortran/FORTRANPPFILESUFFIXES.py
@@ -43,7 +43,8 @@ test.write('myfortran.py', r"""
import getopt
import sys
-comment = '#' + sys.argv[1]
+comment = ('#' + sys.argv[1]).encode()
+length = len(comment)
args = sys.argv[2:]
# First parse defines, since getopt won't have it
defines = []
@@ -58,9 +59,9 @@ for opt, arg in opts:
infile = open(args[0], 'rb')
outfile = open(out, 'wb')
for d in defines:
- outfile.write("#define %s\n" % (d,))
+ outfile.write(("#define %s\n" % (d,)).encode())
for l in infile.readlines():
- if l[:len(comment)] != comment:
+ if l[:length] != comment:
outfile.write(l)
sys.exit(0)
""")