Skip to content

Commit 54ad615

Browse files
committed
commands: Catch an OSErrors for key imports/exports as well.
1 parent b1d1871 commit 54ad615

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

matrix/commands.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ def olm_export_command(server, args):
695695
file_path = os.path.expanduser(args.file)
696696
try:
697697
server.client.export_keys(file_path, args.passphrase)
698-
except IOError as e:
698+
except (OSError, IOError) as e:
699699
server.error("Error exporting keys: {}".format(str(e)))
700700

701701
server.info("Succesfully exported keys")
@@ -704,7 +704,7 @@ def olm_import_command(server, args):
704704
file_path = os.path.expanduser(args.file)
705705
try:
706706
server.client.import_keys(file_path, args.passphrase)
707-
except (IOError, EncryptionError) as e:
707+
except (OSError, IOError, EncryptionError) as e:
708708
server.error("Error importing keys: {}".format(str(e)))
709709

710710
server.info("Succesfully imported keys")

0 commit comments

Comments
 (0)