File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2706,21 +2706,22 @@ static PyObject *
27062706AttributeError_str (PyObject * op )
27072707{
27082708 PyAttributeErrorObject * self = PyAttributeErrorObject_CAST (op );
2709- PyObject * ret , * arg ;
2709+ PyObject * ret = NULL , * arg ;
27102710 Py_BEGIN_CRITICAL_SECTION (self );
27112711 if (
2712- ! self -> obj || ! self -> name || ! PyUnicode_Check (self -> name )
2713- || (PyTuple_GET_SIZE (self -> args ) == 1
2714- && PyUnicode_Check (arg = PyTuple_GET_ITEM (self -> args , 0 ))
2715- && ! PyUnicode_Equal (arg , self -> name ))
2716- || PyTuple_GET_SIZE (self -> args ) != 0
2712+ self -> obj && self -> name && PyUnicode_Check (self -> name )
2713+ && ( (PyTuple_GET_SIZE (self -> args ) == 1
2714+ && PyUnicode_Check (arg = PyTuple_GET_ITEM (self -> args , 0 ))
2715+ && PyUnicode_Equal (arg , self -> name ))
2716+ || PyTuple_GET_SIZE (self -> args ) == 0 )
27172717 ) {
2718- ret = BaseException_str (op );
2719- } else {
27202718 ret = PyUnicode_FromFormat ("%R has no attribute '%U'" ,
27212719 self -> obj , self -> name );
27222720 }
27232721 Py_END_CRITICAL_SECTION ();
2722+ if (!ret ) {
2723+ ret = BaseException_str (op );
2724+ }
27242725 return ret ;
27252726}
27262727
You can’t perform that action at this time.
0 commit comments