dbus/python dbus_bindings.pyx,1.13,1.14

Robert McQueen robot101 at freedesktop.org
Sat Oct 29 15:04:03 PDT 2005


Update of /cvs/dbus/dbus/python
In directory gabe:/tmp/cvs-serv13394/python

Modified Files:
	dbus_bindings.pyx 
Log Message:
2005-10-29  Robert McQueen  <robot101 at 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/.


Index: dbus_bindings.pyx
===================================================================
RCS file: /cvs/dbus/dbus/python/dbus_bindings.pyx,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- dbus_bindings.pyx	29 Oct 2005 19:13:17 -0000	1.13
+++ dbus_bindings.pyx	29 Oct 2005 22:04:01 -0000	1.14
@@ -457,13 +457,12 @@
             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 @@
         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:



More information about the dbus-commit mailing list