Skip to content

Commit

Permalink
Fix split_taps.py to work in python3
Browse files Browse the repository at this point in the history
  • Loading branch information
Phasip authored and Andrew Fasano committed Jan 30, 2024
1 parent 5c8f9b6 commit c5c2ddb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions panda/scripts/split_taps.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

def main(logfile, prefix, num_callers=1):
if logfile.endswith('.gz'):
f = gzip.GzipFile(logfile)
f = gzip.open(logfile, mode='rt')
else:
f = open(logfile)
f = open(logfile,'r')

filemap = {}

Expand All @@ -21,9 +21,9 @@ def main(logfile, prefix, num_callers=1):
callers = callers.split()
fname = prefix + "." + ".".join( callers[-num_callers:] + [pc, stack_kind, sid_first, sid_second] ) + ".dat"
if fname not in filemap:
filemap[fname] = open(fname,'a')
filemap[fname] = open(fname,'ab')

val = val.decode('hex')
val = bytes.fromhex(val)
filemap[fname].write(val)

if __name__ == "__main__":
Expand Down

0 comments on commit c5c2ddb

Please sign in to comment.