[pygobject/invoke-rewrite] [gi] allow marshalling strings as None



commit 7f08fd5c33ee5c9907f5becbe2f21fb7122d6e19
Author: John (J5) Palmieri <johnp redhat com>
Date:   Wed Jan 19 09:45:09 2011 -0500

    [gi] allow marshalling strings as None

 gi/pygi-argument.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/gi/pygi-argument.c b/gi/pygi-argument.c
index e0f3bf0..9ee3e13 100644
--- a/gi/pygi-argument.c
+++ b/gi/pygi-argument.c
@@ -2480,6 +2480,11 @@ _pygi_marshal_in_utf8 (PyGIInvokeState   *state,
 {
     gchar *string_;
 
+    if (py_arg == Py_None) {
+        arg->v_pointer = NULL;
+        return TRUE;
+    }
+
     if (PyUnicode_Check(py_arg)) {
         PyObject *pystr_obj = PyUnicode_AsUTF8String (py_arg);
         if (!pystr_obj)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]