diff --git a/pqcli/roster.py b/pqcli/roster.py index 1833ab5..1537909 100644 --- a/pqcli/roster.py +++ b/pqcli/roster.py @@ -1,3 +1,4 @@ +import os import logging import pickle import typing as T @@ -29,6 +30,8 @@ class Roster: tmp_path.parent.mkdir(parents=True, exist_ok=True) tmp_path.write_bytes(pickle.dumps(self.players)) if self.path.exists(): + if old_path.exists(): + old_path.unlink() self.path.rename(old_path) tmp_path.rename(self.path)