Skip to content

Commit

Permalink
add try/except and save json on exit
Browse files Browse the repository at this point in the history
  • Loading branch information
happycube committed Dec 29, 2018
1 parent ee438a3 commit e77d80c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ld-decode.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,12 @@ def write_json(ldd, outname):
os.rename(outname + '.tbc.json.tmp', outname + '.tbc.json')

for i in range(0, req_frames * 2):
f = ldd.readfield()
try:
f = ldd.readfield()
except:
print("aborted")
write_json(ldd, outname)
exit(1)

if i < 100 or ((i % 1000) == 0):
#print('write json')
Expand Down

0 comments on commit e77d80c

Please sign in to comment.