bpo-37999: No longer use __int__ in implicit integer conversions. (GH-15636)

Only __index__ should be used to make integer conversions lossless.
This commit is contained in:
Serhiy Storchaka 2020-05-26 18:43:38 +03:00 committed by GitHub
parent 8ad052464a
commit 578c3955e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
87 changed files with 226 additions and 2937 deletions

View file

@ -5196,13 +5196,6 @@ sock_initobj(PyObject *self, PyObject *args, PyObject *kwds)
else
#endif
{
if (PyFloat_Check(fdobj)) {
PyErr_SetString(PyExc_TypeError,
"integer argument expected, got float");
return -1;
}
fd = PyLong_AsSocket_t(fdobj);
if (fd == (SOCKET_T)(-1) && PyErr_Occurred())
return -1;