From 6fbd1c7ff5b1023f543a304db4f76fc6eeb4dbd5 Mon Sep 17 00:00:00 2001 From: Robert McQueen Date: Sat, 29 Oct 2005 22:04:01 +0000 Subject: 2005-10-29 Robert McQueen * 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/. --- python/dbus_bindings.pyx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'python/dbus_bindings.pyx') 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: -- cgit