1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-08-03 12:28:13 +00:00

fix UnboundLocalError cache_file referenced before assignment (#102)

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() j = r.json()
except: except:
raise Exception('URL error: %s' % url) raise Exception('URL error: %s' % url)
if cache_file: if cache_dir and cache_file:
try: # saving into cache try: # saving into cache
json.dump(j, open(cachefile, 'w')) json.dump(j, open(cache_file, 'w'))
except: except:
pass pass
return j return j