unix2dos.py: make it ready for python 3

fixes bug #10838
This commit is contained in:
Uwe Stöhr 2017-12-09 00:24:20 +01:00
parent bd40f2a851
commit 8997270a77

View File

@ -7,7 +7,7 @@ for fname in sys.argv[1:]:
infile = open( fname, "rb" ) infile = open( fname, "rb" )
instr = infile.read() instr = infile.read()
infile.close() infile.close()
outstr = instr.replace( "\r\n", "\n" ).replace( "\r", "\n" ).replace( "\n", "\r\n" ) outstr = instr.replace( b"\r\n", b"\n" ).replace( b"\r", b"\n" ).replace( b"\n", b"\r\n" )
if len(outstr) == len(instr): if len(outstr) == len(instr):
continue continue