mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-07 14:00:57 +00:00
feat(python): delete channel_data.json
when clearing all channels
[no changelog]
This commit is contained in:
parent
b0ee4ba1fd
commit
92e307f518
@ -67,9 +67,13 @@ def ensure_file_exists() -> None:
|
|||||||
|
|
||||||
|
|
||||||
def clear_stored_channels() -> None:
|
def clear_stored_channels() -> None:
|
||||||
LOG.debug("Clearing contents of %s - to empty list.", DATA_PATH)
|
LOG.debug("Clearing contents of %s", DATA_PATH)
|
||||||
with open(DATA_PATH, "w") as f:
|
with open(DATA_PATH, "w") as f:
|
||||||
json.dump([], f)
|
json.dump([], f)
|
||||||
|
try:
|
||||||
|
os.remove(DATA_PATH)
|
||||||
|
except Exception as e:
|
||||||
|
LOG.exception("Failed to delete %s (%s)", DATA_PATH, str(type(e)))
|
||||||
|
|
||||||
|
|
||||||
def read_all_channels() -> t.List:
|
def read_all_channels() -> t.List:
|
||||||
|
Loading…
Reference in New Issue
Block a user