Commit 31fc0490 authored by da-woods's avatar da-woods Committed by GitHub

Disable USE_UNICODE_WRITER for Limited API and Py3.11 (GH-4480)

For the Limited API, I'm not sure why USE_UNICODE_WRITER was ever
the default - PyObject_Format() is part of the Limited API so
should clearly be preferred.

Python 3.11 hid _PyLong_FormatAdvancedWriter and
_PyFloat_FormatAdvancedWriter. I've disabled USE_UNICODE_WRITER
for the moment but I suspect we want to find replacements in the longer term.
parent 3e2f28a3
......@@ -125,7 +125,7 @@
#undef CYTHON_USE_UNICODE_INTERNALS
#define CYTHON_USE_UNICODE_INTERNALS 0
#ifndef CYTHON_USE_UNICODE_WRITER
#define CYTHON_USE_UNICODE_WRITER 1
#define CYTHON_USE_UNICODE_WRITER 0
#endif
#undef CYTHON_USE_PYLONG_INTERNALS
#define CYTHON_USE_PYLONG_INTERNALS 0
......@@ -188,7 +188,9 @@
#ifndef CYTHON_USE_UNICODE_INTERNALS
#define CYTHON_USE_UNICODE_INTERNALS 1
#endif
#if PY_VERSION_HEX < 0x030300F0
#if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
// Python 3.11a2 hid _PyLong_FormatAdvancedWriter and _PyFloat_FormatAdvancedWriter
// therefore disable unicode writer until a better alternative appears
#undef CYTHON_USE_UNICODE_WRITER
#define CYTHON_USE_UNICODE_WRITER 0
#elif !defined(CYTHON_USE_UNICODE_WRITER)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment