From dff98456995c37d964eb32a7de7ca718fc3d48d7 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 22 Jan 2008 12:01:18 +0000 Subject: [PATCH] Don't assume that libdbus only gives method call messages to object-path handlers (fd.o #14199) --- NEWS | 4 ++++ dbus/service.py | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 3f97eee..a866177 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,10 @@ Features: Fixes: +* don't emit spurious Error messages if libdbus gives object-path handlers + a message that isn't a method call (most likely because of binding to a + locally emitted signal, as in fd.o #14199) + D-Bus Python Bindings 0.82.4 (2007-12-10) ========================================= diff --git a/dbus/service.py b/dbus/service.py index df9412a..55bb04e 100644 --- a/dbus/service.py +++ b/dbus/service.py @@ -42,7 +42,7 @@ from dbus.decorators import method, signal from dbus.exceptions import DBusException, \ NameExistsException, \ UnknownMethodException -from dbus.lowlevel import ErrorMessage, MethodReturnMessage +from dbus.lowlevel import ErrorMessage, MethodReturnMessage, MethodCallMessage from dbus.proxies import LOCAL_PATH @@ -636,6 +636,9 @@ class Object(Interface): 'on %r', self, connection) def _message_cb(self, connection, message): + if not isinstance(message, MethodCallMessage): + return + try: # lookup candidate method and parent method method_name = message.get_member() -- 2.11.4.GIT