mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-08-02 20:08:31 +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()
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user