mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
bpo-42576: Raise TypeError when passing in keyword arguments to GenericAlias (GH-23656)
Use `_PyArg_NoKeywords` instead of `_PyArg_NoKwnames` when checking the `kwds` tuple when creating `GenericAlias`. This fixes an interpreter crash when passing in keyword arguments to `GenericAlias`'s constructor. Needs backport to 3.9. Automerge-Triggered-By: GH:gvanrossum
This commit is contained in:
parent
da3d2abe6b
commit
804d6893b8
3 changed files with 9 additions and 1 deletions
|
@ -567,7 +567,7 @@ static PyGetSetDef ga_properties[] = {
|
|||
static PyObject *
|
||||
ga_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
||||
{
|
||||
if (!_PyArg_NoKwnames("GenericAlias", kwds)) {
|
||||
if (!_PyArg_NoKeywords("GenericAlias", kwds)) {
|
||||
return NULL;
|
||||
}
|
||||
if (!_PyArg_CheckPositional("GenericAlias", PyTuple_GET_SIZE(args), 2, 2)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue