mirror of
https://github.com/holub/mame
synced 2025-04-26 10:13:37 +03:00
Send error messages to stderr instead of stdout. (nw)
This commit is contained in:
parent
2dfeced11b
commit
b73285d6b3
@ -26,7 +26,7 @@ else:
|
|||||||
try:
|
try:
|
||||||
myfile = open(srcfile, 'rb')
|
myfile = open(srcfile, 'rb')
|
||||||
except IOError:
|
except IOError:
|
||||||
print("Unable to open source file '%s'" % srcfile)
|
sys.stderr.write("Unable to open source file '%s'\n" % srcfile)
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
|
|
||||||
byteCount = os.path.getsize(srcfile)
|
byteCount = os.path.getsize(srcfile)
|
||||||
@ -56,5 +56,5 @@ try:
|
|||||||
dst.write('\n};\n')
|
dst.write('\n};\n')
|
||||||
dst.close()
|
dst.close()
|
||||||
except IOError:
|
except IOError:
|
||||||
print("Unable to open output file '%s'" % dstfile)
|
sys.stderr.write("Unable to open output file '%s'\n" % dstfile)
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
|
@ -10,7 +10,7 @@ def parse_file(srcfile):
|
|||||||
try:
|
try:
|
||||||
fp = open(srcfile, 'rb')
|
fp = open(srcfile, 'rb')
|
||||||
except IOError:
|
except IOError:
|
||||||
print("Unable to open source file '%s'" % srcfile)
|
sys.stderr.write("Unable to open source file '%s'\n" % srcfile)
|
||||||
return 1
|
return 1
|
||||||
in_comment = 0
|
in_comment = 0
|
||||||
linenum = 0
|
linenum = 0
|
||||||
|
@ -15,7 +15,7 @@ def name_to_type(name):
|
|||||||
return 2
|
return 2
|
||||||
if name == "s26":
|
if name == "s26":
|
||||||
return 3
|
return 3
|
||||||
print "Unknown chip type name %s" % name
|
sys.stderr.write("Unknown chip type name %s\n" % name)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
def type_to_device(dtype):
|
def type_to_device(dtype):
|
||||||
@ -96,7 +96,7 @@ class Hash:
|
|||||||
if val in self.d:
|
if val in self.d:
|
||||||
h = self.d[val]
|
h = self.d[val]
|
||||||
if h.premask != premask:
|
if h.premask != premask:
|
||||||
print "Premask conflict"
|
sys.stderr.write("Premask conflict\n")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
return h
|
return h
|
||||||
h = Hash(premask)
|
h = Hash(premask)
|
||||||
@ -105,7 +105,7 @@ class Hash:
|
|||||||
|
|
||||||
def set(self, val, opc):
|
def set(self, val, opc):
|
||||||
if val in self.d:
|
if val in self.d:
|
||||||
print "Collision on %s" % opc.description()
|
sys.stderr.write("Collision on %s\n" % opc.description())
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
self.d[val] = opc
|
self.d[val] = opc
|
||||||
|
|
||||||
@ -331,7 +331,7 @@ class OpcodeList:
|
|||||||
if v in h.d:
|
if v in h.d:
|
||||||
d = h.d[v]
|
d = h.d[v]
|
||||||
if not d.is_dispatch():
|
if not d.is_dispatch():
|
||||||
print "Collision on %s" % opc.description()
|
sys.stderr.write("Collision on %s\n" % opc.description())
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
if opc.enabled:
|
if opc.enabled:
|
||||||
d.enabled = True
|
d.enabled = True
|
||||||
|
@ -121,15 +121,15 @@ else:
|
|||||||
chdmanBin = os.path.normpath(os.path.join(currentDirectory, "..", "..", "..", "chdman"))
|
chdmanBin = os.path.normpath(os.path.join(currentDirectory, "..", "..", "..", "chdman"))
|
||||||
|
|
||||||
if not os.path.exists(chdmanBin):
|
if not os.path.exists(chdmanBin):
|
||||||
print chdmanBin + " does not exist"
|
sys.stderr.write(chdmanBin + " does not exist\n")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if not os.path.exists(inputPath):
|
if not os.path.exists(inputPath):
|
||||||
print inputPath + " does not exist"
|
sys.stderr.write(inputPath + " does not exist\n")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if not os.path.exists(outputPath):
|
if not os.path.exists(outputPath):
|
||||||
print outputPath + " does not exist"
|
sys.stderr.write(outputPath + " does not exist\n")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if os.path.exists(tempPath):
|
if os.path.exists(tempPath):
|
||||||
|
Loading…
Reference in New Issue
Block a user