1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-12 18:49:07 +00:00

res_collect: fix if resources.py does not exist

This commit is contained in:
Pavol Rusnak 2017-06-13 20:15:47 +02:00
parent 3d7a9d780d
commit f93b8a08bc
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -47,9 +47,13 @@ for k in sorted(resources.keys()):
bio.write(" '%s': %s,\n" % (k, resources[k]))
bio.write('}\n')
with open(resfile, 'r') as f:
stale = f.read()
fresh = bio.getvalue()
try:
with open(resfile, 'r') as f:
stale = f.read()
except:
stale = None
fresh = bio.getvalue()
if stale != fresh:
with open(resfile, 'wt') as f: