diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2016-03-21 20:20:50 +0100 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2016-03-21 20:20:50 +0100 |
commit | 033344ce1557468b39b054c5a7041a2daa57900d (patch) | |
tree | 3c58876a5d3d535d70d38507ba5e0ddb4b39214e /Cython/Utility/ModuleSetupCode.c | |
parent | faa9ed0a785c59c7062cbd061227f421fd507e87 (diff) | |
download | cython-033344ce1557468b39b054c5a7041a2daa57900d.tar.gz |
make missing PyObject_ASCII() function sort-of available in Py2 (to be used by f-strings)
Diffstat (limited to 'Cython/Utility/ModuleSetupCode.c')
-rw-r--r-- | Cython/Utility/ModuleSetupCode.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Cython/Utility/ModuleSetupCode.c b/Cython/Utility/ModuleSetupCode.c index 28728384c..427137f15 100644 --- a/Cython/Utility/ModuleSetupCode.c +++ b/Cython/Utility/ModuleSetupCode.c @@ -133,6 +133,10 @@ #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif + #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject |