summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/dbus_bindings.pyx3
-rw-r--r--python/service.py18
2 files changed, 13 insertions, 8 deletions
diff --git a/python/dbus_bindings.pyx b/python/dbus_bindings.pyx
index 00603734..35ad492b 100644
--- a/python/dbus_bindings.pyx
+++ b/python/dbus_bindings.pyx
@@ -978,7 +978,6 @@ cdef class MessageIter:
return (sig, remainder)
def append_strict(self, value, sig):
-
if sig == TYPE_INVALID or sig == None:
raise TypeError, 'Invalid arg type sent to append_strict'
@@ -1023,7 +1022,7 @@ cdef class MessageIter:
retval = self.append_array(Array(value, signature=tmp_sig))
elif sig_type == TYPE_OBJECT_PATH:
retval = self.append_object_path(value)
- elif sig_type == TYPE_STRUCT:
+ elif sig_type == STRUCT_BEGIN:
tmp_sig = sig[1:-1]
retval = self.append_struct(value, signature = tmp_sig)
elif sig_type == TYPE_VARIANT:
diff --git a/python/service.py b/python/service.py
index a4391837..0cc2ed9f 100644
--- a/python/service.py
+++ b/python/service.py
@@ -168,13 +168,19 @@ class Object:
print ("Unregister")
def _message_cb(self, connection, message):
- target_method_name = message.get_member()
- target_methods = self._dbus_method_vtable[target_method_name]
- args = message.get_args_list()
+ try:
+ target_method_name = message.get_member()
+ target_methods = self._dbus_method_vtable[target_method_name]
+ args = message.get_args_list()
- reply = _dispatch_dbus_method_call(target_methods, self, args, message)
-
- self._connection.send(reply)
+ reply = _dispatch_dbus_method_call(target_methods, self, args, message)
+
+ self._connection.send(reply)
+ except Exception, e:
+ error_reply = dbus_bindings.Error(message,
+ "org.freedesktop.DBus.Python.%s" % e.__class__.__name__,
+ str(e))
+ self._connection.send(error_reply)
@method('org.freedesktop.DBus.Introspectable')
def Introspect(self):