diff options
author | Johannes Krampf <johannes.krampf@googlemail.com> | 2014-01-19 16:03:49 +0100 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2014-01-20 12:42:44 -0500 |
commit | 19f789bdfd58eba2ed8fe604bbabf8df0fcc0771 (patch) | |
tree | 51c49104aec5b420382f82f71e3b4a8edf0be8f1 /scripts/layoutrom.py | |
parent | 0a82fc743c5ec1553f745bec6fc8bc8780088fd8 (diff) | |
download | seabios-19f789bdfd58eba2ed8fe604bbabf8df0fcc0771.tar.gz |
build: Be careful with unicode and byte strings for python3 compatibility.
Signed-off-by: Johannes Krampf <johannes.krampf@googlemail.com>
Diffstat (limited to 'scripts/layoutrom.py')
-rwxr-xr-x | scripts/layoutrom.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/scripts/layoutrom.py b/scripts/layoutrom.py index 3e57787d..b3254061 100755 --- a/scripts/layoutrom.py +++ b/scripts/layoutrom.py @@ -363,7 +363,7 @@ def writeLinkerScripts(li, out16, out32seg, out32flat): int(li.zonelow_base / 16), li.sec16_start - BUILD_BIOS_ADDR, outRelSections(li.sections16, 'code16_start', useseg=1)) - outfile = open(out16, 'wb') + outfile = open(out16, 'w') outfile.write(COMMONHEADER + out + COMMONTRAILER) outfile.close() @@ -375,7 +375,7 @@ def writeLinkerScripts(li, out16, out32seg, out32flat): } """ % (li.sec32seg_start - BUILD_BIOS_ADDR, outRelSections(li.sections32seg, 'code32seg_start', useseg=1)) - outfile = open(out32seg, 'wb') + outfile = open(out32seg, 'w') outfile.write(COMMONHEADER + out + COMMONTRAILER) outfile.close() @@ -445,7 +445,7 @@ PHDRS text PT_LOAD AT ( code32flat_start ) ; } """ - outfile = open(out32flat, 'wb') + outfile = open(out32flat, 'w') outfile.write(out) outfile.close() @@ -644,7 +644,7 @@ def parseObjDump(file, fileid): # Parser for constants in simple C header files. def scanconfig(file): - f = open(file, 'rb') + f = open(file, 'r') opts = {} for l in f.readlines(): parts = l.split() @@ -663,9 +663,9 @@ def main(): in16, in32seg, in32flat, cfgfile, out16, out32seg, out32flat = sys.argv[1:] # Read in the objdump information - infile16 = open(in16, 'rb') - infile32seg = open(in32seg, 'rb') - infile32flat = open(in32flat, 'rb') + infile16 = open(in16, 'r') + infile32seg = open(in32seg, 'r') + infile32flat = open(in32flat, 'r') # infoX = (sections, symbols) info16 = parseObjDump(infile16, '16') |