gh-124502: Add PyUnicode_Equal() function (#124504)
This commit is contained in:
@@ -11001,6 +11001,24 @@ _PyUnicode_Equal(PyObject *str1, PyObject *str2)
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
PyUnicode_Equal(PyObject *str1, PyObject *str2)
|
||||
{
|
||||
if (!PyUnicode_Check(str1)) {
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"first argument must be str, not %T", str1);
|
||||
return -1;
|
||||
}
|
||||
if (!PyUnicode_Check(str2)) {
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"second argument must be str, not %T", str2);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return _PyUnicode_Equal(str1, str2);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
PyUnicode_Compare(PyObject *left, PyObject *right)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user