From 01c2c860ed291d1e0193715a329d9fb19f140c18 Mon Sep 17 00:00:00 2001 From: "John (J5) Palmieri" Date: Thu, 15 Apr 2010 15:28:29 -0400 Subject: make sure we correctly chose between string and unicode --- gi/pygi-info.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/gi/pygi-info.c b/gi/pygi-info.c index 7acedd7..6f89e51 100644 --- a/gi/pygi-info.c +++ b/gi/pygi-info.c @@ -134,13 +134,25 @@ PyTypeObject PyGIBaseInfo_Type = { static PyObject * _wrap_g_base_info_get_name (PyGIBaseInfo *self) { - return PyUnicode_FromString(g_base_info_get_name(self->info)); + return +#if PY_MAJOR_VERSION >= 3 + PyUnicode_FromString +#else + PyString_FromString +#endif + (g_base_info_get_name(self->info)); } static PyObject * _wrap_g_base_info_get_namespace (PyGIBaseInfo *self) { - return PyUnicode_FromString(g_base_info_get_namespace(self->info)); + return +#if PY_MAJOR_VERSION >= 3 + PyUnicode_FromString +#else + PyString_FromString +#endif + (g_base_info_get_namespace(self->info)); } static PyObject * -- cgit