open input and output files in binary mode so ^Z doesn't bite us on windows

This commit is contained in:
Bill Currie 2007-04-07 10:15:17 +00:00 committed by Jeff Teunissen
parent 323052bd2b
commit a6104bc0fc

View file

@ -95,7 +95,7 @@ verbose = 0
def append_file (filename): def append_file (filename):
global current_file global current_file
f = open (filename, "rt") f = open (filename, "rb")
lines = f.readlines () lines = f.readlines ()
f.close () f.close ()
current_file.append ('# 1 "' + filename + '"') current_file.append ('# 1 "' + filename + '"')
@ -312,7 +312,7 @@ def process_source (source_file):
if compile_this_file: if compile_this_file:
fname = source_file + '.pqc' fname = source_file + '.pqc'
qcc_list.append (fname) qcc_list.append (fname)
f = open (fname, "wt") f = open (fname, "wb")
for l in output: for l in output:
f.write(l + '\n') f.write(l + '\n')
f.close () f.close ()
@ -339,7 +339,7 @@ for s in source_list:
if s[0]=='#': if s[0]=='#':
continue # preprocessor directive continue # preprocessor directive
process_source (s) process_source (s)
f = open (progs_src, "wt") f = open (progs_src, "wb")
f.write (progs_dat + '\n\n') f.write (progs_dat + '\n\n')
for l in qcc_list: for l in qcc_list:
f.write(l + '\n') f.write(l + '\n')