@@ -1418,17 +1418,17 @@ _PyNumber_Index(PyObject *item)
14181418
14191419 if (!PyLong_Check (result )) {
14201420 PyErr_Format (PyExc_TypeError ,
1421- "__index__ returned non-int (type %.200s)" ,
1422- Py_TYPE (result )-> tp_name );
1421+ "%.200s. __index__ returned non-int (type %.200s)" ,
1422+ Py_TYPE (item ) -> tp_name , Py_TYPE ( result )-> tp_name );
14231423 Py_DECREF (result );
14241424 return NULL ;
14251425 }
14261426 /* Issue #17576: warn if 'result' not of exact type int. */
14271427 if (PyErr_WarnFormat (PyExc_DeprecationWarning , 1 ,
1428- "__index__ returned non-int (type %.200s). "
1428+ "%.200s. __index__ returned non-int (type %.200s). "
14291429 "The ability to return an instance of a strict subclass of int "
14301430 "is deprecated, and may be removed in a future version of Python." ,
1431- Py_TYPE (result )-> tp_name )) {
1431+ Py_TYPE (item ) -> tp_name , Py_TYPE ( result )-> tp_name )) {
14321432 Py_DECREF (result );
14331433 return NULL ;
14341434 }
@@ -1528,17 +1528,17 @@ PyNumber_Long(PyObject *o)
15281528
15291529 if (!PyLong_Check (result )) {
15301530 PyErr_Format (PyExc_TypeError ,
1531- "__int__ returned non-int (type %.200s)" ,
1532- Py_TYPE (result )-> tp_name );
1531+ "%.200s. __int__ returned non-int (type %.200s)" ,
1532+ Py_TYPE (o ) -> tp_name , Py_TYPE ( result )-> tp_name );
15331533 Py_DECREF (result );
15341534 return NULL ;
15351535 }
15361536 /* Issue #17576: warn if 'result' not of exact type int. */
15371537 if (PyErr_WarnFormat (PyExc_DeprecationWarning , 1 ,
1538- "__int__ returned non-int (type %.200s). "
1538+ "%.200s. __int__ returned non-int (type %.200s). "
15391539 "The ability to return an instance of a strict subclass of int "
15401540 "is deprecated, and may be removed in a future version of Python." ,
1541- Py_TYPE (result )-> tp_name )) {
1541+ Py_TYPE (o ) -> tp_name , Py_TYPE ( result )-> tp_name )) {
15421542 Py_DECREF (result );
15431543 return NULL ;
15441544 }
@@ -2815,9 +2815,9 @@ PyObject_GetIter(PyObject *o)
28152815 PyObject * res = (* f )(o );
28162816 if (res != NULL && !PyIter_Check (res )) {
28172817 PyErr_Format (PyExc_TypeError ,
2818- "iter() returned non-iterator "
2818+ "%.100s. iter() returned non-iterator "
28192819 "of type '%.100s'" ,
2820- Py_TYPE (res )-> tp_name );
2820+ Py_TYPE (o ) -> tp_name , Py_TYPE ( res )-> tp_name );
28212821 Py_SETREF (res , NULL );
28222822 }
28232823 return res ;
0 commit comments