Merge pull request #12419 from ARMmbed/fix-gh12290

Fix #12290: crash_log_parser on py3
pull/12431/head
Martin Kojtal 2020-02-13 09:47:50 +00:00 committed by GitHub
commit 7634f3684a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -33,7 +33,7 @@ _PTN = re.compile("([0-9a-f]*) ([Tt]) ([^\t\n]*)(?:\t(.*):([0-9]*))?")
class ElfHelper(object):
def __init__(self, elf_file, map_file):
op = check_output([_NM_EXEC, _OPT, elf_file.name])
op = check_output([_NM_EXEC, _OPT, elf_file.name]).decode('utf-8')
self.maplines = map_file.readlines()
self.matches = _PTN.findall(op)
self.addrs = [int(x[0], 16) for x in self.matches]
@ -115,7 +115,7 @@ def parse_line_for_register(line):
def main(crash_log, elfhelper):
mmfar_val = 0
bfar_val = 0
lines = iter(crash_log.read().splitlines())
lines = iter(crash_log.read().decode('utf-8').splitlines())
for eachline in lines:
if "++ MbedOS Fault Handler ++" in eachline: