From e616e810fc3317e0b91d0b8cef52875a112d4e39 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sat, 2 Mar 2019 19:00:30 +0100 Subject: [PATCH] Don't use PyOS_FSPath() with PyPy3.6 The latest PyPy 3.6 release doesn't implement PyOS_FSPath, so don't use it for now. --- cairo/misc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cairo/misc.c b/cairo/misc.c index 27a8e00..cb0b428 100644 --- a/cairo/misc.c +++ b/cairo/misc.c @@ -41,7 +41,9 @@ int Pycairo_is_fspath (PyObject *obj) { #if PY_MAJOR_VERSION < 3 return (PyString_Check (obj) || PyUnicode_Check (obj)); -#elif PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 6 +#elif PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 6 && !defined(PYPY_VERSION) + /* PyOS_FSPath() is missing in PyPy: + * https://bitbucket.org/pypy/pypy/issues/2961 */ PyObject *real = PyOS_FSPath (obj); if (real == NULL) { PyErr_Clear ();