Merge pull request #3530 from wavexx/py_no_ex_dataerr

tools: Do not use os.EX_DATAERR due to unavailability on windows
This commit is contained in:
Alex Voinea 2022-07-04 17:52:21 +02:00 committed by GitHub
commit 65e19f6b0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 8 deletions

View file

@ -326,7 +326,7 @@ def main():
for translation in polib.pofile(args.po):
status &= check_translation(translation, msgids, args.pot, args.no_warning, args.no_suggest,
args.warn_empty, args.warn_same, args.information)
return 0 if status else os.EX_DATAERR
return 0 if status else 1
if __name__ == "__main__":
exit(main())

View file

@ -1,6 +1,6 @@
#!/usr/bin/env python3
import argparse
import os, sys
import sys
from lib.dump import decode_dump
@ -21,7 +21,7 @@ def main():
# decode the dump data
dump = decode_dump(args.dump)
if dump is None:
return os.EX_DATAERR
return 1
# output descriptors
if args.info:

View file

@ -4,7 +4,6 @@ import elftools.elf.elffile
import elftools.dwarf.descriptions
from collections import namedtuple
from struct import unpack
import os
import re
from lib.dump import decode_dump
@ -374,7 +373,7 @@ def main():
# fetch the memory data
dump = decode_dump(args.dump)
if dump is None:
return os.EX_DATAERR
return 1
# strip padding, if present
addr_start = dump.ranges[0][0]

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python3
import argparse
import struct
import os, sys
import sys
from lib.dump import DUMP_MAGIC, DUMP_OFFSET, DUMP_SIZE
@ -25,13 +25,13 @@ def main():
data = fd.read(DUMP_SIZE)
if len(data) != DUMP_SIZE:
error('incorrect image size')
return os.EX_DATAERR
return 1
# check for magic header
magic, = struct.unpack('<L', data[:4])
if magic != DUMP_MAGIC:
error('invalid dump magic or no dump')
return os.EX_DATAERR
return 1
# output D21 dump
print('D21 - read crash dump', end='')