Commit 79aea265 authored by Simon Feltman's avatar Simon Feltman
Browse files

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
parent f32d649b
...@@ -1367,13 +1367,6 @@ _pygi_marshal_from_py_interface_callback (PyGIInvokeState *state, ...@@ -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) { if (py_arg == Py_None) {
return TRUE; return TRUE;
} }
......
...@@ -1565,10 +1565,13 @@ class TestTreeView(unittest.TestCase): ...@@ -1565,10 +1565,13 @@ class TestTreeView(unittest.TestCase):
def test_tree_view_column(self): def test_tree_view_column(self):
cell = Gtk.CellRendererText() cell = Gtk.CellRendererText()
Gtk.TreeViewColumn(title='This is just a test', col = Gtk.TreeViewColumn(title='This is just a test',
cell_renderer=cell, cell_renderer=cell,
text=0, text=0,
style=2) 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): def test_tree_view_add_column_with_attributes(self):
model = Gtk.ListStore(str, str, str) model = Gtk.ListStore(str, str, str)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment