mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
libretro-mame2016: fix build with Python 3
Universal newline handling is default since Python 3 and the "U" file mode has been deprecated and is finally removed now. Drop the "U" flag to fix build with Python 3.11 Signed-off-by: Matthias Reichl <hias@horus.com>
This commit is contained in:
parent
2b6a943e03
commit
fff4968047
69
packages/emulation/libretro-mame2016/patches/python3.patch
Normal file
69
packages/emulation/libretro-mame2016/patches/python3.patch
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
diff -ru a/scripts/build/verinfo.py b/scripts/build/verinfo.py
|
||||||
|
--- a/scripts/build/verinfo.py 2022-04-06 22:13:09.000000000 +0200
|
||||||
|
+++ b/scripts/build/verinfo.py 2022-11-12 01:58:14.560895085 +0100
|
||||||
|
@@ -63,7 +63,7 @@
|
||||||
|
build, outfmt, srcfile, dstfile = parse_args()
|
||||||
|
|
||||||
|
try:
|
||||||
|
- fp = open(srcfile, 'rU')
|
||||||
|
+ fp = open(srcfile, 'r')
|
||||||
|
except IOError:
|
||||||
|
sys.stderr.write("Unable to open source file '%s'\n" % srcfile)
|
||||||
|
sys.exit(1)
|
||||||
|
diff -ru a/src/devices/cpu/m6502/m6502make.py b/src/devices/cpu/m6502/m6502make.py
|
||||||
|
--- a/src/devices/cpu/m6502/m6502make.py 2022-04-06 22:13:09.000000000 +0200
|
||||||
|
+++ b/src/devices/cpu/m6502/m6502make.py 2022-11-12 01:58:41.276911837 +0100
|
||||||
|
@@ -18,7 +18,7 @@
|
||||||
|
opcodes = []
|
||||||
|
logging.info("load_opcodes: %s", fname)
|
||||||
|
try:
|
||||||
|
- f = open(fname, "rU")
|
||||||
|
+ f = open(fname, "r")
|
||||||
|
except Exception:
|
||||||
|
err = sys.exc_info()[1]
|
||||||
|
logging.error("cannot read opcodes file %s [%s]", fname, err)
|
||||||
|
@@ -41,7 +41,7 @@
|
||||||
|
logging.info("load_disp: %s", fname)
|
||||||
|
states = []
|
||||||
|
try:
|
||||||
|
- f = open(fname, "rU")
|
||||||
|
+ f = open(fname, "r")
|
||||||
|
except Exception:
|
||||||
|
err = sys.exc_info()[1]
|
||||||
|
logging.error("cannot read display file %s [%s]", fname, err)
|
||||||
|
diff -ru a/src/devices/cpu/m6809/m6809make.py b/src/devices/cpu/m6809/m6809make.py
|
||||||
|
--- a/src/devices/cpu/m6809/m6809make.py 2022-04-06 22:13:09.000000000 +0200
|
||||||
|
+++ b/src/devices/cpu/m6809/m6809make.py 2022-11-12 01:58:23.972900989 +0100
|
||||||
|
@@ -16,7 +16,7 @@
|
||||||
|
if path != "":
|
||||||
|
path += '/'
|
||||||
|
try:
|
||||||
|
- f = open(fname, "rU")
|
||||||
|
+ f = open(fname, "r")
|
||||||
|
except Exception:
|
||||||
|
err = sys.exc_info()[1]
|
||||||
|
sys.stderr.write("Cannot read opcodes file %s [%s]\n" % (fname, err))
|
||||||
|
diff -ru a/src/devices/cpu/mcs96/mcs96make.py b/src/devices/cpu/mcs96/mcs96make.py
|
||||||
|
--- a/src/devices/cpu/mcs96/mcs96make.py 2022-04-06 22:13:09.000000000 +0200
|
||||||
|
+++ b/src/devices/cpu/mcs96/mcs96make.py 2022-11-12 01:59:08.144928680 +0100
|
||||||
|
@@ -73,7 +73,7 @@
|
||||||
|
self.ea = {}
|
||||||
|
self.macros = {}
|
||||||
|
try:
|
||||||
|
- f = open(fname, "rU")
|
||||||
|
+ f = open(fname, "r")
|
||||||
|
except Exception:
|
||||||
|
err = sys.exc_info()[1]
|
||||||
|
sys.stderr.write("Cannot read opcodes file %s [%s]\n" % (fname, err))
|
||||||
|
diff -ru a/src/devices/cpu/tms57002/tmsmake.py b/src/devices/cpu/tms57002/tmsmake.py
|
||||||
|
--- a/src/devices/cpu/tms57002/tmsmake.py 2022-04-06 22:13:09.000000000 +0200
|
||||||
|
+++ b/src/devices/cpu/tms57002/tmsmake.py 2022-11-12 01:58:58.908922895 +0100
|
||||||
|
@@ -323,7 +323,7 @@
|
||||||
|
def LoadLst(filename):
|
||||||
|
instructions = []
|
||||||
|
ins = None
|
||||||
|
- for n, line in enumerate(open(filename, "rU")):
|
||||||
|
+ for n, line in enumerate(open(filename, "r")):
|
||||||
|
line = line.rstrip()
|
||||||
|
if not line and ins:
|
||||||
|
# new lines separate intructions
|
Loading…
x
Reference in New Issue
Block a user