File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -11012,14 +11012,18 @@ _PyUnicode_Equal(PyObject *str1, PyObject *str2)
1101211012int
1101311013PyUnicode_Equal (PyObject * str1 , PyObject * str2 )
1101411014{
11015- if (PyUnicode_Check (str1 ) && PyUnicode_Check (str2 )) {
11016- return _PyUnicode_Equal (str1 , str2 );
11015+ if (!PyUnicode_Check (str1 )) {
11016+ PyErr_Format (PyExc_TypeError ,
11017+ "first argument must be str, not %T" , str1 );
11018+ return -1 ;
11019+ }
11020+ if (!PyUnicode_Check (str2 )) {
11021+ PyErr_Format (PyExc_TypeError ,
11022+ "second argument must be str, not %T" , str2 );
11023+ return -1 ;
1101711024 }
1101811025
11019- PyErr_Format (PyExc_TypeError ,
11020- "Can't compare %T and %T" ,
11021- str1 , str2 );
11022- return -1 ;
11026+ return _PyUnicode_Equal (str1 , str2 );
1102311027}
1102411028
1102511029
You can’t perform that action at this time.
0 commit comments