diff options
author | Simon Feltman <sfeltman@src.gnome.org> | 2013-11-04 03:29:57 -0800 |
---|---|---|
committer | Simon Feltman <sfeltman@src.gnome.org> | 2013-11-04 03:29:57 -0800 |
commit | 79aea2655db11bc9d2c0ad75c87862b2b66da594 (patch) | |
tree | b8d92b5c4fa9f8718718f775521287c13a20fa86 | |
parent | f32d649b72f865e32cc2b62a54d927b8345da0c8 (diff) | |
download | pygobject-79aea2655db11bc9d2c0ad75c87862b2b66da594.tar.gz |
Remove overzealous argument checking for callback userdata
Remove check which ensures userdata is None if the callback is None.
This check would need to become more complicated with recent versions of
PyGObject where userdata can be variable (would also need to check against
a tuple containing None). Instead of adding more complex checking, simply
remove the checking as it is unnecessary to begin with.
https://bugzilla.gnome.org/show_bug.cgi?id=711173
-rw-r--r-- | gi/pygi-marshal-from-py.c | 7 | ||||
-rw-r--r-- | tests/test_overrides_gtk.py | 11 |
2 files changed, 7 insertions, 11 deletions
diff --git a/gi/pygi-marshal-from-py.c b/gi/pygi-marshal-from-py.c index 7bcba666..ed2e5822 100644 --- a/gi/pygi-marshal-from-py.c +++ b/gi/pygi-marshal-from-py.c @@ -1367,13 +1367,6 @@ _pygi_marshal_from_py_interface_callback (PyGIInvokeState *state, } } - if (py_arg == Py_None && !(py_user_data == Py_None || py_user_data == NULL)) { - PyErr_Format (PyExc_TypeError, - "When passing None for a callback userdata must also be None"); - - return FALSE; - } - if (py_arg == Py_None) { return TRUE; } diff --git a/tests/test_overrides_gtk.py b/tests/test_overrides_gtk.py index fd97908b..fefc9a85 100644 --- a/tests/test_overrides_gtk.py +++ b/tests/test_overrides_gtk.py @@ -1565,10 +1565,13 @@ class TestTreeView(unittest.TestCase): def test_tree_view_column(self): cell = Gtk.CellRendererText() - Gtk.TreeViewColumn(title='This is just a test', - cell_renderer=cell, - text=0, - style=2) + col = Gtk.TreeViewColumn(title='This is just a test', + cell_renderer=cell, + text=0, + style=2) + + # Regression test for: https://bugzilla.gnome.org/show_bug.cgi?id=711173 + col.set_cell_data_func(cell, None, None) def test_tree_view_add_column_with_attributes(self): model = Gtk.ListStore(str, str, str) |