User: Fix @gpg remove with some gpg configs.

This commit is contained in:
Valentin Lorentz 2014-08-29 16:17:18 +00:00
parent 06b865597f
commit e6d80f9346

View File

@ -454,7 +454,10 @@ class User(callbacks.Plugin):
if len(keyids) == 0:
raise ValueError
for keyid in keyids:
user.gpgkeys.remove(keyid)
try:
user.gpgkeys.remove(keyid)
except ValueError:
user.gpgkeys.remove('0x' + keyid)
gpg.keyring.delete_keys(fingerprint)
irc.replySuccess()
except ValueError: