summaryrefslogtreecommitdiff
path: root/test/DVIPDF
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2017-03-19 20:36:25 -0700
committerWilliam Deegan <bill@baddogconsulting.com>2017-03-19 20:36:25 -0700
commitb297637e996387cf8a5645c7fcaee662cfc88a6b (patch)
tree7a9627555ab976b9e11dba3a5bbfa37efe91cefa /test/DVIPDF
parent008fc596747e0a5255a7ce27ca103d9538944107 (diff)
downloadscons-b297637e996387cf8a5645c7fcaee662cfc88a6b.tar.gz
py2/3 rb/ab/wb fixes
Diffstat (limited to 'test/DVIPDF')
-rw-r--r--test/DVIPDF/DVIPDF.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/DVIPDF/DVIPDF.py b/test/DVIPDF/DVIPDF.py
index 5c722315..b60107dc 100644
--- a/test/DVIPDF/DVIPDF.py
+++ b/test/DVIPDF/DVIPDF.py
@@ -38,10 +38,10 @@ import sys
import getopt
cmd_opts, arg = getopt.getopt(sys.argv[1:], 'i:r:', [])
base_name = os.path.splitext(arg[0])[0]
-infile = open(arg[0], 'rb')
-out_file = open(base_name+'.dvi', 'wb')
+infile = open(arg[0], 'r')
+out_file = open(base_name+'.dvi', 'w')
for l in infile.readlines():
- if l[:4] != b'#tex':
+ if l[:4] != '#tex':
out_file.write(l)
sys.exit(0)
""")
@@ -52,10 +52,10 @@ import sys
import getopt
cmd_opts, arg = getopt.getopt(sys.argv[1:], 'i:r:', [])
base_name = os.path.splitext(arg[0])[0]
-infile = open(arg[0], 'rb')
-out_file = open(base_name+'.dvi', 'wb')
+infile = open(arg[0], 'r')
+out_file = open(base_name+'.dvi', 'w')
for l in infile.readlines():
- if l[:6] != b'#latex':
+ if l[:6] != '#latex':
out_file.write(l)
sys.exit(0)
""")
@@ -65,10 +65,10 @@ import os
import sys
import getopt
cmd_opts, arg = getopt.getopt(sys.argv[1:], 'i:r:', [])
-infile = open(arg[0], 'rb')
-out_file = open(arg[1], 'wb')
+infile = open(arg[0], 'r')
+out_file = open(arg[1], 'w')
for l in infile.readlines():
- if l[:7] != b'#dvipdf':
+ if l[:7] != '#dvipdf':
out_file.write(l)
sys.exit(0)
""")
@@ -110,7 +110,7 @@ if dvipdf and tex:
test.write("wrapper.py", """import os
import sys
cmd = " ".join(sys.argv[1:])
-open('%s', 'ab').write("%%s\\n" %% cmd)
+open('%s', 'a').write("%%s\\n" %% cmd)
os.system(cmd)
""" % test.workpath('wrapper.out').replace('\\', '\\\\'))