mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-96348: Deprecate the 3-arg signature of coroutine.throw and generator.throw (GH-96428)
This commit is contained in:
parent
9a11ed8e50
commit
83a3de4e06
14 changed files with 125 additions and 21 deletions
|
@ -1668,6 +1668,14 @@ FutureIter_throw(futureiterobject *self, PyObject *const *args, Py_ssize_t nargs
|
|||
if (!_PyArg_CheckPositional("throw", nargs, 1, 3)) {
|
||||
return NULL;
|
||||
}
|
||||
if (nargs > 1) {
|
||||
if (PyErr_WarnEx(PyExc_DeprecationWarning,
|
||||
"the (type, exc, tb) signature of throw() is deprecated, "
|
||||
"use the single-arg signature instead.",
|
||||
1) < 0) {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
type = args[0];
|
||||
if (nargs == 3) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue