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:
@@ -281,12 +281,6 @@ _io__WindowsConsoleIO___init___impl(winconsoleio *self, PyObject *nameobj,
|
||||
self->handle = INVALID_HANDLE_VALUE;
|
||||
}
|
||||
|
||||
if (PyFloat_Check(nameobj)) {
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
"integer argument expected, got float");
|
||||
return -1;
|
||||
}
|
||||
|
||||
fd = _PyLong_AsInt(nameobj);
|
||||
if (fd < 0) {
|
||||
if (!PyErr_Occurred()) {
|
||||
|
||||
Reference in New Issue
Block a user