mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
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:
parent
8ad052464a
commit
578c3955e0
87 changed files with 226 additions and 2937 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue