From 61d97ad8e9952cee608d02be682c40859bc87a1b Mon Sep 17 00:00:00 2001 From: Craig Rodrigues Date: Mon, 13 Mar 2017 23:54:18 -0700 Subject: Use byte strings to fix test on Python 3. --- test/DVIPDF/DVIPDF.py | 6 +++--- test/DVIPS/DVIPS.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/DVIPDF/DVIPDF.py b/test/DVIPDF/DVIPDF.py index e760741..5c72231 100644 --- a/test/DVIPDF/DVIPDF.py +++ b/test/DVIPDF/DVIPDF.py @@ -41,7 +41,7 @@ base_name = os.path.splitext(arg[0])[0] infile = open(arg[0], 'rb') out_file = open(base_name+'.dvi', 'wb') for l in infile.readlines(): - if l[:4] != '#tex': + if l[:4] != b'#tex': out_file.write(l) sys.exit(0) """) @@ -55,7 +55,7 @@ base_name = os.path.splitext(arg[0])[0] infile = open(arg[0], 'rb') out_file = open(base_name+'.dvi', 'wb') for l in infile.readlines(): - if l[:6] != '#latex': + if l[:6] != b'#latex': out_file.write(l) sys.exit(0) """) @@ -68,7 +68,7 @@ cmd_opts, arg = getopt.getopt(sys.argv[1:], 'i:r:', []) infile = open(arg[0], 'rb') out_file = open(arg[1], 'wb') for l in infile.readlines(): - if l[:7] != '#dvipdf': + if l[:7] != b'#dvipdf': out_file.write(l) sys.exit(0) """) diff --git a/test/DVIPS/DVIPS.py b/test/DVIPS/DVIPS.py index b243bfc..256258f 100644 --- a/test/DVIPS/DVIPS.py +++ b/test/DVIPS/DVIPS.py @@ -41,7 +41,7 @@ base_name = os.path.splitext(arg[0])[0] infile = open(arg[0], 'rb') out_file = open(base_name+'.dvi', 'wb') for l in infile.readlines(): - if l[:4] != '#tex': + if l[:4] != b'#tex': out_file.write(l) sys.exit(0) """) @@ -55,7 +55,7 @@ base_name = os.path.splitext(arg[0])[0] infile = open(arg[0], 'rb') out_file = open(base_name+'.dvi', 'wb') for l in infile.readlines(): - if l[:6] != '#latex': + if l[:6] != b'#latex': out_file.write(l) sys.exit(0) """) @@ -66,7 +66,7 @@ import sys infile = open(sys.argv[3], 'rb') out_file = open(sys.argv[2], 'wb') for l in infile.readlines(): - if l[:6] != '#dvips': + if l[:6] != b'#dvips': out_file.write(l) sys.exit(0) """) -- cgit v0.12