8000 #undefine "PyUnicode_IS_READY" and friends in Py3.12 since CPython st… · lxml/lxml@06631bb · GitHub
[go: up one dir, main page]

Skip to content

Commit 06631bb

Browse files
committed
#undefine "PyUnicode_IS_READY" and friends in Py3.12 since CPython still defines them as dummies.
1 parent ef0b0b4 commit 06631bb

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/lxml/includes/etree_defs.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,6 @@
7878
# define PyFile_AsFile(o) (NULL)
7979
#endif
8080

81-
#if PY_VERSION_HEX <= 0x03030000 && !(defined(CYTHON_PEP393_ENABLED) && CYTHON_PEP393_ENABLED)
82-
#define PyUnicode_IS_READY(op) (0)
83-
#define PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
84-
#define PyUnicode_KIND(u) (sizeof(Py_UNICODE))
85-
#define PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
86-
#endif
87-
8881
#if IS_PYPY
8982
# ifndef PyUnicode_FromFormat
9083
# define PyUnicode_FromFormat PyString_FromFormat

src/lxml/python.pxd

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,16 @@ cdef extern from *:
88
cdef extern from "Python.h":
99
"""
1010
#if defined(CYTHON_PEP393_ENABLED) && CYTHON_PEP393_ENABLED
11-
#if PY_VERSION_HEX >= 0x030C0000 && !defined(PyUnicode_IS_READY)
11+
#if PY_VERSION_HEX >= 0x030C0000
12+
#undef PyUnicode_IS_READY
1213
#define PyUnicode_IS_READY(s) (1)
14+
#undef PyUnicode_READY
1315
#define PyUnicode_READY(s) (0)
16+
#undef PyUnicode_AS_DATA
1417
#define PyUnicode_AS_DATA(s) (0)
18+
#undef PyUnicode_GET_DATA_SIZE
1519
#define PyUnicode_GET_DATA_SIZE(s) (0)
20+
#undef PyUnicode_GET_SIZE
1621
#define PyUnicode_GET_SIZE(s) (0)
1722
#endif
1823
#elif PY_VERSION_HEX <= 0x03030000

0 commit comments

Comments
 (0)
0