summaryrefslogtreecommitdiff
path: root/Cython/Utility
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2018-05-18 16:01:40 +0200
committerStefan Behnel <stefan_ml@behnel.de>2018-05-18 16:01:40 +0200
commitac6b858e79e83f991eee21667ab0cd8031faad73 (patch)
tree4459f484f7a27af6493f11958af97a2a70b1e754 /Cython/Utility
parenteb0e46660cbbab70d4dcb53f94a4749ab261510b (diff)
downloadcython-ac6b858e79e83f991eee21667ab0cd8031faad73.tar.gz
Prevent UnicodeEncodeError in Py2 when ``%s`` formatting is optimised for unicode strings.
Diffstat (limited to 'Cython/Utility')
-rw-r--r--Cython/Utility/ModuleSetupCode.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Cython/Utility/ModuleSetupCode.c b/Cython/Utility/ModuleSetupCode.c
index 2aeabd2fe..a96f6f5e9 100644
--- a/Cython/Utility/ModuleSetupCode.c
+++ b/Cython/Utility/ModuleSetupCode.c
@@ -558,6 +558,7 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
#define PyString_Type PyUnicode_Type
#define PyString_Check PyUnicode_Check
#define PyString_CheckExact PyUnicode_CheckExact
+ #define PyObject_Unicode PyObject_Str
#endif
#if PY_MAJOR_VERSION >= 3