py_panda: Don't use _PyUnicode_EqualToASCIIString in Python 3.13+

See #1523
This commit is contained in:
rdb 2023-08-03 22:21:42 +02:00
parent 3f3819e7fa
commit 3160d7f3e9

View File

@ -801,7 +801,7 @@ bool Dtool_ExtractArg(PyObject **result, PyObject *args, PyObject *kwds,
if (kwds != nullptr && PyDict_GET_SIZE(kwds) == 1 &&
PyDict_Next(kwds, &ppos, &key, result)) {
// We got the item, we just need to make sure that it had the right key.
#if PY_VERSION_HEX >= 0x03060000
#if PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030D0000
return PyUnicode_CheckExact(key) && _PyUnicode_EqualToASCIIString(key, keyword);
#elif PY_MAJOR_VERSION >= 3
return PyUnicode_CheckExact(key) && PyUnicode_CompareWithASCIIString(key, keyword) == 0;