[pygobject] pygi-info: use PYGLIB_PyBytes_AsString instead of checking



commit dda0e9ba1da5e58e324b1d14cda02a7c1fc773e6
Author: Havard Graff <havard graff gmail com>
Date:   Tue Mar 13 14:39:54 2018 +0100

    pygi-info: use PYGLIB_PyBytes_AsString instead of checking

 gi/pygi-info.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
---
diff --git a/gi/pygi-info.c b/gi/pygi-info.c
index 4bd4c1cc..70101587 100644
--- a/gi/pygi-info.c
+++ b/gi/pygi-info.c
@@ -600,12 +600,7 @@ _function_info_call (PyGICallableInfo *self, PyObject *args, PyObject *kwargs)
                 py_str_name = tmp;
             }
 
-#if PY_VERSION_HEX < 0x03000000
-            str_name = PyString_AsString (py_str_name);
-#else
-            str_name = PyBytes_AsString (py_str_name);
-#endif
-
+            str_name = PYGLIB_PyBytes_AsString (py_str_name);
             if (strcmp (str_name, _safe_base_info_get_name (container_info))) {
                 PyErr_Format (PyExc_TypeError,
                               "%s constructor cannot be used to create instances of "


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