mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-17 13:12:05 +00:00
fix UnboundLocalError cache_file referenced before assignment (#102)
This commit is contained in:
parent
127d76a913
commit
b29331ca40
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user