mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-25 06:13:54 +00:00
98dc4cfa9c
Since Python 3.11, `open()` etc. no longer accept `U` flag.
75 lines
2.7 KiB
Diff
75 lines
2.7 KiB
Diff
diff --git a/scripts/build/verinfo.py b/scripts/build/verinfo.py
|
|
index a73d8ad268..82a80c0984 100644
|
|
--- a/scripts/build/verinfo.py
|
|
+++ b/scripts/build/verinfo.py
|
|
@@ -63,7 +63,7 @@ def extract_version(input):
|
|
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 --git a/src/devices/cpu/m6502/m6502make.py b/src/devices/cpu/m6502/m6502make.py
|
|
index 8bcd85f8e2..557b175966 100755
|
|
--- a/src/devices/cpu/m6502/m6502make.py
|
|
+++ b/src/devices/cpu/m6502/m6502make.py
|
|
@@ -18,7 +18,7 @@ def load_opcodes(fname):
|
|
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 @@ def load_disp(fname):
|
|
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 --git a/src/devices/cpu/m6809/m6809make.py b/src/devices/cpu/m6809/m6809make.py
|
|
index 8838b96019..e1ea25db06 100644
|
|
--- a/src/devices/cpu/m6809/m6809make.py
|
|
+++ b/src/devices/cpu/m6809/m6809make.py
|
|
@@ -16,7 +16,7 @@ def load_file(fname, lines):
|
|
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 --git a/src/devices/cpu/mcs96/mcs96make.py b/src/devices/cpu/mcs96/mcs96make.py
|
|
index b4844942e3..207208d2b6 100644
|
|
--- a/src/devices/cpu/mcs96/mcs96make.py
|
|
+++ b/src/devices/cpu/mcs96/mcs96make.py
|
|
@@ -73,7 +73,7 @@ def __init__(self, fname, is_196):
|
|
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 --git a/src/devices/cpu/tms57002/tmsmake.py b/src/devices/cpu/tms57002/tmsmake.py
|
|
index e2e12b5a4b..942ec09537 100755
|
|
--- a/src/devices/cpu/tms57002/tmsmake.py
|
|
+++ b/src/devices/cpu/tms57002/tmsmake.py
|
|
@@ -323,7 +323,7 @@ def AddInfo(self, line):
|
|
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
|