summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Henstridge <james@daa.com.au>2002-08-17 13:59:45 +0000
committerJames Henstridge <jamesh@src.gnome.org>2002-08-17 13:59:45 +0000
commit53f22d8e4f362ca96c543311d0c107c6b88633a7 (patch)
tree50a96655f2e42d38cc6169a6291c12681807780e
parent3b069a1dca0c8bd147ec1e2ea7a544e9f75d6032 (diff)
downloadpygobject-53f22d8e4f362ca96c543311d0c107c6b88633a7.tar.gz
pygobject-53f22d8e4f362ca96c543311d0c107c6b88633a7.tar.xz
pygobject-53f22d8e4f362ca96c543311d0c107c6b88633a7.zip
allow None when converting to string GValue (bug picked up by Thomas
2002-08-17 James Henstridge <james@daa.com.au> * pygtype.c (pyg_value_from_pyobject): allow None when converting to string GValue (bug picked up by Thomas Leonard. * gtk/gtk.defs (scroll_to_cell): allow column to be None (bug #90398).
-rw-r--r--gobject/pygtype.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gobject/pygtype.c b/gobject/pygtype.c
index 09edeb1..febb304 100644
--- a/gobject/pygtype.c
+++ b/gobject/pygtype.c
@@ -423,7 +423,9 @@ pyg_value_from_pyobject(GValue *value, PyObject *obj)
}
break;
case G_TYPE_STRING:
- if ((tmp = PyObject_Str(obj)))
+ if (obj == Py_None)
+ g_value_set_string(value, NULL);
+ else if ((tmp = PyObject_Str(obj)))
g_value_set_string(value, PyString_AsString(tmp));
else {
PyErr_Clear();