mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #26136: Upgrade the generator_stop warning to DeprecationWarning
Patch by Anish Shah.
This commit is contained in:
parent
b0cb42dfdb
commit
7e3a91a5fc
6 changed files with 19 additions and 7 deletions
|
@ -178,7 +178,7 @@ gen_send_ex(PyGenObject *gen, PyObject *arg, int exc)
|
|||
/* Pop the exception before issuing a warning. */
|
||||
PyErr_Fetch(&exc, &val, &tb);
|
||||
|
||||
if (PyErr_WarnFormat(PyExc_PendingDeprecationWarning, 1,
|
||||
if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
|
||||
"generator '%.50S' raised StopIteration",
|
||||
gen->gi_qualname)) {
|
||||
/* Warning was converted to an error. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue