mirror of
https://github.com/holub/mame
synced 2025-10-06 17:08:28 +03:00
Merge pull request #145 from reedlove/patch-2
Update file2str.py for Python 3 compat
This commit is contained in:
commit
2e209c805e
@ -40,7 +40,10 @@ try:
|
|||||||
chunk = src.read(16)
|
chunk = src.read(16)
|
||||||
if chunk:
|
if chunk:
|
||||||
for b in chunk:
|
for b in chunk:
|
||||||
dst.write('0x%02x' % ord(b))
|
# For Python 2.x compatibility.
|
||||||
|
if isinstance(b, str):
|
||||||
|
b = ord(b)
|
||||||
|
dst.write('0x%02x' % b)
|
||||||
offs = offs + 1
|
offs = offs + 1
|
||||||
if offs != byteCount:
|
if offs != byteCount:
|
||||||
dst.write(',')
|
dst.write(',')
|
||||||
|
Loading…
Reference in New Issue
Block a user