mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Issue #21193: Make (e.g.,) pow(2, -3, 5) raise ValueError rather than TypeError. Patch by Josh Rosenberg.
This commit is contained in:
parent
138185fa05
commit
0c346d827d
4 changed files with 6 additions and 2 deletions
|
@ -3841,7 +3841,7 @@ long_pow(PyObject *v, PyObject *w, PyObject *x)
|
|||
|
||||
if (Py_SIZE(b) < 0) { /* if exponent is negative */
|
||||
if (c) {
|
||||
PyErr_SetString(PyExc_TypeError, "pow() 2nd argument "
|
||||
PyErr_SetString(PyExc_ValueError, "pow() 2nd argument "
|
||||
"cannot be negative when 3rd argument specified");
|
||||
goto Error;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue