Commit 54aa043d authored by Simon Feltman's avatar Simon Feltman
Browse files

Unify utf8 to Python GI marshaling code

Change _pygi_argument_to_object to use the cachers marshaler
(_pygi_marshal_to_py_utf8) directly instead of keeping a
copy of the code.

https://bugzilla.gnome.org/show_bug.cgi?id=693405
parent 03ff41ae
......@@ -1527,14 +1527,11 @@ _pygi_argument_to_object (GIArgument *arg,
break;
}
case GI_TYPE_TAG_UTF8:
if (arg->v_string == NULL) {
object = Py_None;
Py_INCREF (object);
break;
}
object = PYGLIB_PyUnicode_FromString (arg->v_string);
{
object = _pygi_marshal_to_py_utf8 (NULL, NULL, NULL,
arg);
break;
}
case GI_TYPE_TAG_FILENAME:
{
GError *error = NULL;
......
......@@ -293,9 +293,7 @@ _pygi_marshal_to_py_utf8 (PyGIInvokeState *state,
{
PyObject *py_obj = NULL;
if (arg->v_string == NULL) {
py_obj = Py_None;
Py_INCREF (py_obj);
return py_obj;
Py_RETURN_NONE;
}
py_obj = PYGLIB_PyUnicode_FromString (arg->v_string);
......
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