mirror of
https://github.com/python/cpython.git
synced 2025-07-12 13:55:34 +00:00
gh-98783: Fix crashes when str
subclasses are used in _PyUnicode_Equal
(#98806)
This commit is contained in:
parent
3ac8c0ab6e
commit
76f989dc3e
5 changed files with 36 additions and 3 deletions
|
@ -10444,8 +10444,8 @@ unicode_compare_eq(PyObject *str1, PyObject *str2)
|
|||
int
|
||||
_PyUnicode_Equal(PyObject *str1, PyObject *str2)
|
||||
{
|
||||
assert(PyUnicode_CheckExact(str1));
|
||||
assert(PyUnicode_CheckExact(str2));
|
||||
assert(PyUnicode_Check(str1));
|
||||
assert(PyUnicode_Check(str2));
|
||||
if (str1 == str2) {
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue