diff options
author | John (J5) Palmieri <johnp@redhat.com> | 2010-04-15 15:28:29 -0400 |
---|---|---|
committer | John (J5) Palmieri <johnp@redhat.com> | 2010-04-15 15:28:29 -0400 |
commit | 01c2c860ed291d1e0193715a329d9fb19f140c18 (patch) | |
tree | df852c9789dd1c1b58315576f93a18164d14be7e | |
parent | 7c8e0638ba53c6771ae6adfcb0c74d3db9bfff18 (diff) | |
download | pygi-01c2c860ed291d1e0193715a329d9fb19f140c18.tar.gz pygi-01c2c860ed291d1e0193715a329d9fb19f140c18.tar.xz pygi-01c2c860ed291d1e0193715a329d9fb19f140c18.zip |
make sure we correctly chose between string and unicode
-rw-r--r-- | gi/pygi-info.c | 16 |
1 files 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 * |