diff options
author | Ofey Chan <ofey206@gmail.com> | 2022-09-30 08:43:02 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-30 08:43:02 (GMT) |
commit | 83a3de4e0632d90e0d1d5a9b8859a94c9ac25f65 (patch) | |
tree | 31d942b63699bc5e1848ffb6f85901fe8b93301c /Modules | |
parent | 9a11ed8e50492d327e4de0a8f3a473e788b14a6f (diff) | |
download | cpython-83a3de4e0632d90e0d1d5a9b8859a94c9ac25f65.zip cpython-83a3de4e0632d90e0d1d5a9b8859a94c9ac25f65.tar.gz cpython-83a3de4e0632d90e0d1d5a9b8859a94c9ac25f65.tar.bz2 |
gh-96348: Deprecate the 3-arg signature of coroutine.throw and generator.throw (GH-96428)
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_asynciomodule.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c index 9d2f83b..5a5881b 100644 --- a/Modules/_asynciomodule.c +++ b/Modules/_asynciomodule.c @@ -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) { |