diff options
Diffstat (limited to 'src/psutils.py')
-rw-r--r-- | src/psutils.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/psutils.py b/src/psutils.py index 7863535..6b8ec95 100644 --- a/src/psutils.py +++ b/src/psutils.py @@ -54,6 +54,18 @@ class WrongConnectionError(DBusException): self._dbus_error_name = PRESENCE_INTERFACE + '.WrongConnection' +def throw_into_callback(async_err_cb, exc): + # Made necessary by https://bugs.freedesktop.org/show_bug.cgi?id=12403 + # When that bug is fixed, replace: + # throw_into_callback(async_err_cb, SomeError('foo')) + # with the more obvious: + # async_err_cb(SomeError('foo')) + try: + raise exc + except: + async_err_cb(exc) + + def pubkey_to_keyid(key): """Return the key ID for the given public key. This is currently its SHA-1 in hex. |