1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-18 20:38:10 +00:00

fix UnboundLocalError cache_file referenced before assignment ()

This commit is contained in:
mruddy 2017-02-26 05:35:36 -05:00 committed by Pavol Rusnak
parent 127d76a913
commit b29331ca40
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -45,9 +45,9 @@ class TxApi(object):
j = r.json()
except:
raise Exception('URL error: %s' % url)
if cache_file:
if cache_dir and cache_file:
try: # saving into cache
json.dump(j, open(cachefile, 'w'))
json.dump(j, open(cache_file, 'w'))
except:
pass
return j