mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Improve error message from nb_int returning a non-integer, in various PyInt_As* functions:
This commit is contained in:
parent
8651810df9
commit
328284adcf
1 changed files with 4 additions and 4 deletions
|
@ -178,7 +178,7 @@ PyInt_AsLong(register PyObject *op)
|
|||
{
|
||||
Py_DECREF(io);
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
"nb_int should return int object");
|
||||
"__int__ method should return an integer");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
@ -236,7 +236,7 @@ PyInt_AsSsize_t(register PyObject *op)
|
|||
{
|
||||
Py_DECREF(io);
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
"nb_int should return int object");
|
||||
"__int__ method should return an integer");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
@ -281,7 +281,7 @@ PyInt_AsUnsignedLongMask(register PyObject *op)
|
|||
{
|
||||
Py_DECREF(io);
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
"nb_int should return int object");
|
||||
"__int__ method should return an integer");
|
||||
return (unsigned long)-1;
|
||||
}
|
||||
}
|
||||
|
@ -326,7 +326,7 @@ PyInt_AsUnsignedLongLongMask(register PyObject *op)
|
|||
{
|
||||
Py_DECREF(io);
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
"nb_int should return int object");
|
||||
"__int__ method should return an integer");
|
||||
return (unsigned PY_LONG_LONG)-1;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue