diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2020-05-26 15:43:38 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-26 15:43:38 (GMT) |
commit | 578c3955e0222ec7b3146197467fbb0fcfae12fe (patch) | |
tree | 1314ca1eb6153feaf3fb1cae341784270ce24c32 /Modules/_blake2 | |
parent | 8ad052464a4e0aef9a11663b80f187087b773592 (diff) | |
download | cpython-578c3955e0222ec7b3146197467fbb0fcfae12fe.zip cpython-578c3955e0222ec7b3146197467fbb0fcfae12fe.tar.gz cpython-578c3955e0222ec7b3146197467fbb0fcfae12fe.tar.bz2 |
bpo-37999: No longer use __int__ in implicit integer conversions. (GH-15636)
Only __index__ should be used to make integer conversions lossless.
Diffstat (limited to 'Modules/_blake2')
-rw-r--r-- | Modules/_blake2/clinic/blake2b_impl.c.h | 27 | ||||
-rw-r--r-- | Modules/_blake2/clinic/blake2s_impl.c.h | 27 |
2 files changed, 2 insertions, 52 deletions
diff --git a/Modules/_blake2/clinic/blake2b_impl.c.h b/Modules/_blake2/clinic/blake2b_impl.c.h index 07258c3..4e74e08 100644 --- a/Modules/_blake2/clinic/blake2b_impl.c.h +++ b/Modules/_blake2/clinic/blake2b_impl.c.h @@ -56,11 +56,6 @@ skip_optional_posonly: goto skip_optional_kwonly; } if (fastargs[1]) { - if (PyFloat_Check(fastargs[1])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } digest_size = _PyLong_AsInt(fastargs[1]); if (digest_size == -1 && PyErr_Occurred()) { goto exit; @@ -106,11 +101,6 @@ skip_optional_posonly: } } if (fastargs[5]) { - if (PyFloat_Check(fastargs[5])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } fanout = _PyLong_AsInt(fastargs[5]); if (fanout == -1 && PyErr_Occurred()) { goto exit; @@ -120,11 +110,6 @@ skip_optional_posonly: } } if (fastargs[6]) { - if (PyFloat_Check(fastargs[6])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } depth = _PyLong_AsInt(fastargs[6]); if (depth == -1 && PyErr_Occurred()) { goto exit; @@ -150,11 +135,6 @@ skip_optional_posonly: } } if (fastargs[9]) { - if (PyFloat_Check(fastargs[9])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } node_depth = _PyLong_AsInt(fastargs[9]); if (node_depth == -1 && PyErr_Occurred()) { goto exit; @@ -164,11 +144,6 @@ skip_optional_posonly: } } if (fastargs[10]) { - if (PyFloat_Check(fastargs[10])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } inner_size = _PyLong_AsInt(fastargs[10]); if (inner_size == -1 && PyErr_Occurred()) { goto exit; @@ -272,4 +247,4 @@ _blake2_blake2b_hexdigest(BLAKE2bObject *self, PyObject *Py_UNUSED(ignored)) { return _blake2_blake2b_hexdigest_impl(self); } -/*[clinic end generated code: output=2d6d0fe9aa42a42a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=10eb47aba77f192d input=a9049054013a1b77]*/ diff --git a/Modules/_blake2/clinic/blake2s_impl.c.h b/Modules/_blake2/clinic/blake2s_impl.c.h index 71c5706..0f0d983 100644 --- a/Modules/_blake2/clinic/blake2s_impl.c.h +++ b/Modules/_blake2/clinic/blake2s_impl.c.h @@ -56,11 +56,6 @@ skip_optional_posonly: goto skip_optional_kwonly; } if (fastargs[1]) { - if (PyFloat_Check(fastargs[1])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } digest_size = _PyLong_AsInt(fastargs[1]); if (digest_size == -1 && PyErr_Occurred()) { goto exit; @@ -106,11 +101,6 @@ skip_optional_posonly: } } if (fastargs[5]) { - if (PyFloat_Check(fastargs[5])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } fanout = _PyLong_AsInt(fastargs[5]); if (fanout == -1 && PyErr_Occurred()) { goto exit; @@ -120,11 +110,6 @@ skip_optional_posonly: } } if (fastargs[6]) { - if (PyFloat_Check(fastargs[6])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } depth = _PyLong_AsInt(fastargs[6]); if (depth == -1 && PyErr_Occurred()) { goto exit; @@ -150,11 +135,6 @@ skip_optional_posonly: } } if (fastargs[9]) { - if (PyFloat_Check(fastargs[9])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } node_depth = _PyLong_AsInt(fastargs[9]); if (node_depth == -1 && PyErr_Occurred()) { goto exit; @@ -164,11 +144,6 @@ skip_optional_posonly: } } if (fastargs[10]) { - if (PyFloat_Check(fastargs[10])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } inner_size = _PyLong_AsInt(fastargs[10]); if (inner_size == -1 && PyErr_Occurred()) { goto exit; @@ -272,4 +247,4 @@ _blake2_blake2s_hexdigest(BLAKE2sObject *self, PyObject *Py_UNUSED(ignored)) { return _blake2_blake2s_hexdigest_impl(self); } -/*[clinic end generated code: output=c80d8d06ce40a192 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f7ee8092ed67e9c7 input=a9049054013a1b77]*/ |