| 1573 | // gh-124502 added PyUnicode_Equal() to Python 3.14.0a0 |
| 1574 | #if PY_VERSION_HEX < 0x030E00A0 |
| 1575 | static inline int PyUnicode_Equal(PyObject *str1, PyObject *str2) |
| 1576 | { |
| 1577 | if (!PyUnicode_Check(str1)) { |
| 1578 | PyErr_Format(PyExc_TypeError, "first argument must be str, not %s", |
| 1579 | Py_TYPE(str1)->tp_name); |
| 1580 | return -1; |
| 1581 | } |
| 1582 | if (!PyUnicode_Check(str2)) { |
| 1583 | PyErr_Format(PyExc_TypeError, "second argument must be str, not %s", |
| 1584 | Py_TYPE(str2)->tp_name); |
| 1585 | return -1; |
| 1586 | } |
| 1587 | |
| 1588 | #if PY_VERSION_HEX >= 0x030d0000 && !defined(PYPY_VERSION) |
| 1589 | PyAPI_FUNC(int) _PyUnicode_Equal(PyObject *str1, PyObject *str2); |
| 1590 | |
| 1591 | return _PyUnicode_Equal(str1, str2); |
| 1592 | #elif PY_VERSION_HEX >= 0x03060000 && !defined(PYPY_VERSION) |
| 1593 | return _PyUnicode_EQ(str1, str2); |
| 1594 | #elif PY_VERSION_HEX >= 0x03090000 && defined(PYPY_VERSION) |
| 1595 | return _PyUnicode_EQ(str1, str2); |
| 1596 | #else |
| 1597 | return (PyUnicode_Compare(str1, str2) == 0); |
| 1598 | #endif |
| 1599 | } |
| 1600 | #endif |
| 1601 | |
| 1602 |
nothing calls this directly
no outgoing calls
no test coverage detected