1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-05 21:10:57 +00:00

feat(python): delete channel_data.json when clearing all channels

[no changelog]
This commit is contained in:
M1nd3r 2024-11-19 18:14:45 +01:00
parent b0ee4ba1fd
commit 92e307f518

View File

@ -67,9 +67,13 @@ def ensure_file_exists() -> 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:
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: