From aefb314999c00279cd7346210fe321d89b6ae1ae Mon Sep 17 00:00:00 2001 From: miruka Date: Sun, 8 Sep 2019 12:17:08 -0400 Subject: [PATCH] Fix exporting key to a path that doesn't exist yet --- src/python/matrix_client.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/python/matrix_client.py b/src/python/matrix_client.py index 97e10502..589b261e 100644 --- a/src/python/matrix_client.py +++ b/src/python/matrix_client.py @@ -345,9 +345,9 @@ class MatrixClient(nio.AsyncClient): path = Path(outfile) path.parent.mkdir(parents=True, exist_ok=True) - # Remove any existing file - # (the QML dialog asks the user if he wants to overwrite before this) - path.unlink() + # The QML dialog asks the user if he wants to overwrite before this + if path.exists(): + path.unlink() await super().export_keys(outfile, passphrase)