--- gobject/pygtype.c	2006/08/20 14:20:54	1.1
+++ gobject/pygtype.c	2006/08/20 20:39:14
@@ -849,7 +849,23 @@ pyg_value_from_pyobject(GValue *value, P
 	    g_value_set_boxed(value, NULL);
 	if (G_VALUE_HOLDS(value, PY_TYPE_OBJECT))
 	    g_value_set_boxed(value, obj);
-	else if (PyObject_TypeCheck(obj, &PyGBoxed_Type) &&
+	else if (G_VALUE_HOLDS(value, G_TYPE_VALUE)) {
+	    GType type;
+	    GValue obj_value = { 0, };
+
+	    type = pyg_type_from_object((PyObject *) obj->ob_type);
+	    if (! type) {
+		PyErr_Clear();
+		return -1;
+	    }
+	    g_value_init(&obj_value, type);
+	    if (pyg_value_from_pyobject(&obj_value, obj) == -1) {
+		g_value_unset(&obj_value);
+		return -1;
+	    }
+	    g_value_set_boxed(value, &obj_value);
+	    g_value_unset(&obj_value);
+	} else if (PyObject_TypeCheck(obj, &PyGBoxed_Type) &&
 		   G_VALUE_HOLDS(value, ((PyGBoxed *)obj)->gtype))
 	    g_value_set_boxed(value, pyg_boxed_get(obj, gpointer));
 	else if (PySequence_Check(obj) &&
@@ -1006,7 +1022,10 @@ pyg_value_as_pyobject(const GValue *valu
 		return Py_None;
 	    }
 	    return ret;
-	} else if (G_VALUE_HOLDS(value, G_TYPE_VALUE_ARRAY)) {
+	} else if (G_VALUE_HOLDS(value, G_TYPE_VALUE))
+	    return pyg_value_as_pyobject((GValue *) g_value_get_boxed(value),
+					 copy_boxed);
+	else if (G_VALUE_HOLDS(value, G_TYPE_VALUE_ARRAY)) {
 	    GValueArray *array = (GValueArray *) g_value_get_boxed(value);
 	    PyObject *ret = PyList_New(array->n_values);
 	    int i;
