From 45bb91ed37f94140132742ab63a9a0d01f4f1b07 Mon Sep 17 00:00:00 2001 From: Jukka Lehtosalo Date: Sun, 14 Jul 2024 13:02:31 +0100 Subject: [PATCH] [mypyc] Don't use _PyUnicode_EQ on 3.13, as it's no longer exported (#17523) Work on mypyc/mypyc#1056. --- mypyc/lib-rt/getargsfast.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mypyc/lib-rt/getargsfast.c b/mypyc/lib-rt/getargsfast.c index 387deed4399b..62d0dfed0a6d 100644 --- a/mypyc/lib-rt/getargsfast.c +++ b/mypyc/lib-rt/getargsfast.c @@ -271,9 +271,16 @@ find_keyword(PyObject *kwnames, PyObject *const *kwstack, PyObject *key) for (i = 0; i < nkwargs; i++) { PyObject *kwname = PyTuple_GET_ITEM(kwnames, i); assert(PyUnicode_Check(kwname)); +#if CPY_3_13_FEATURES + if (_PyUnicode_Equal(kwname, key)) { + return kwstack[i]; + } +#else if (_PyUnicode_EQ(kwname, key)) { return kwstack[i]; } +#endif + } return NULL; }