summaryrefslogtreecommitdiffstats
path: root/python/dbus_bindings.pyx
diff options
context:
space:
mode:
authorRobert McQueen <robot101@debian.org>2005-10-29 22:04:01 +0000
committerRobert McQueen <robot101@debian.org>2005-10-29 22:04:01 +0000
commit6fbd1c7ff5b1023f543a304db4f76fc6eeb4dbd5 (patch)
tree0ca5b3936376fe84c9df1153019f28408254310d /python/dbus_bindings.pyx
parent20bcbaf21f4e94c48d6348a4ba8013d20f9e4d36 (diff)
2005-10-29 Robert McQueen <robot101@debian.org>
* python/dbus_bindings.pyx: Tweak 'raise AssertionError' to assert(). Add checking for the end of struct character when marshalling a struct in MessageIter.append_strict. * python/examples/example-service.py, python/examples/gconf-proxy-service.py, python/examples/gconf-proxy-service2.py: Update to use gobject mainloop directly rather than appearing to depend on gtk. * python/test/test-client.py, python/test/test-server.py: Remove obsolete and broken test scripts for old bindings. We have up to date and working tests in test/python/.
Diffstat (limited to 'python/dbus_bindings.pyx')
-rw-r--r--python/dbus_bindings.pyx10
1 files changed, 6 insertions, 4 deletions
diff --git a/python/dbus_bindings.pyx b/python/dbus_bindings.pyx
index fe6e7777..c693a3d0 100644
--- a/python/dbus_bindings.pyx
+++ b/python/dbus_bindings.pyx
@@ -457,13 +457,12 @@ cdef class Connection:
dbus_error_free (&error)
raise DBusException, errormsg
- if retval == NULL:
- raise AssertionError
-
+ assert(retval != NULL)
+
m = EmptyMessage()
m._set_msg(retval)
- return m
+ return m
def set_watch_functions(self, add_function, remove_function, data):
pass
@@ -1048,6 +1047,9 @@ cdef class MessageIter:
elif sig_type == TYPE_OBJECT_PATH:
retval = self.append_object_path(value)
elif sig_type == STRUCT_BEGIN:
+ if ord(sig[-1]) != STRUCT_END:
+ raise TypeError, "Invalid struct entry in append_strict. No termination in signature %s." % (sig)
+
tmp_sig = sig[1:-1]
retval = self.append_struct(value, signature = tmp_sig)
elif sig_type == TYPE_VARIANT: