diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2007-02-21 15:04:20 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2007-02-21 15:04:20 +0000 |
commit | f1e0a64b9f02a77cfd468f146ed3f398b2c1c8bc (patch) | |
tree | c4fd3d2d343e4515f6257e27e9e6885367e246ec /_dbus_bindings/conn-methods.c | |
parent | 8dce2df1ceacffb2aa6e2cc8b1d4b58ee95ac5b1 (diff) | |
download | dbus-python-f1e0a64b9f02a77cfd468f146ed3f398b2c1c8bc.tar.gz |
If send_with_reply() returns TRUE but with pending call NULL, cope gracefully.
This is a workaround for the fact that trying to use the object path
/org/freedesktop/DBus/Local in a message header (e.g. when introspecting
trackerd with dbus-inspector) causes us to be disconnected by the bus daemon.
Diffstat (limited to '_dbus_bindings/conn-methods.c')
-rw-r--r-- | _dbus_bindings/conn-methods.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/_dbus_bindings/conn-methods.c b/_dbus_bindings/conn-methods.c index dae1816..d4d031b 100644 --- a/_dbus_bindings/conn-methods.c +++ b/_dbus_bindings/conn-methods.c @@ -403,6 +403,13 @@ Connection_send_message_with_reply(Connection *self, PyObject *args, PyObject *k return PyErr_NoMemory(); } + if (!pending) { + /* connection is disconnected (doesn't return FALSE!) */ + PyErr_SetString (DBusPyException, "Connection is disconnected - " + "unable to make method call"); + return NULL; + } + return DBusPyPendingCall_ConsumeDBusPendingCall(pending, callable); } |