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,18 +2706,14 @@ static PyObject *
27062706AttributeError_str (PyObject * op )
27072707{
27082708 PyAttributeErrorObject * self = PyAttributeErrorObject_CAST (op );
2709- if (
2710- self -> obj
2711- && self -> name
2712- && (!PyTuple_GET_SIZE (self -> args )
2713- || (PyTuple_GET_SIZE (self -> args ) == 1
2714- && PyUnicode_Equal (PyTuple_GET_ITEM (self -> args , 0 ), self -> name ))
2715- )
2716- ) {
2717- return PyUnicode_FromFormat ("%R has no attribute '%U'" ,
2718- self -> obj , self -> name );
2709+ if (!self -> obj || !self -> name || PyTuple_GET_SIZE (self -> args ) > 1
2710+ || (PyTuple_GET_SIZE (self -> args ) == 1 &&
2711+ !PyUnicode_Equal (PyTuple_GET_ITEM (self -> args , 0 ), self -> name )))
2712+ {
2713+ return BaseException_str (op );
27192714 }
2720- return BaseException_str (op );
2715+ return PyUnicode_FromFormat ("%R has no attribute '%U'" ,
2716+ self -> obj , self -> name );
27212717}
27222718
27232719static int
You can’t perform that action at this time.
0 commit comments