Merge pull request #8330 from theotherjimmy/force-int-time

Tools: Fix Python3 + firmware header traeback
pull/8192/merge
Martin Kojtal 2018-10-09 10:31:26 -05:00 committed by GitHub
commit 4a0e2bdb31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -377,7 +377,7 @@ def _fill_header(region_list, current_region):
elif type == "timestamp": elif type == "timestamp":
fmt = {"32le": "<L", "64le": "<Q", fmt = {"32le": "<L", "64le": "<Q",
"32be": ">L", "64be": ">Q"}[subtype] "32be": ">L", "64be": ">Q"}[subtype]
header.puts(start, struct.pack(fmt, time())) header.puts(start, struct.pack(fmt, int(time())))
elif type == "size": elif type == "size":
fmt = {"32le": "<L", "64le": "<Q", fmt = {"32le": "<L", "64le": "<Q",
"32be": ">L", "64be": ">Q"}[subtype] "32be": ">L", "64be": ">Q"}[subtype]