diff options
author | kj <28750310+Fidget-Spinner@users.noreply.github.com> | 2020-12-05 23:02:14 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-05 08:02:14 -0800 |
commit | 804d6893b801e8f30318afc38c20d4d0e6161db3 (patch) | |
tree | 54ab5cd365ec99fa0cd95cb690bb9ef3d02f9658 /Objects/genericaliasobject.c | |
parent | GH-5054: CGIHTTPRequestHandler.run_cgi() HTTP_ACCEPT improperly parsed (#23638) (diff) | |
download | cpython-804d6893b801e8f30318afc38c20d4d0e6161db3.tar.gz cpython-804d6893b801e8f30318afc38c20d4d0e6161db3.tar.bz2 cpython-804d6893b801e8f30318afc38c20d4d0e6161db3.zip |
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
Diffstat (limited to 'Objects/genericaliasobject.c')
-rw-r--r-- | Objects/genericaliasobject.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/genericaliasobject.c b/Objects/genericaliasobject.c index 6102e05c165..51a12377b7e 100644 --- a/Objects/genericaliasobject.c +++ b/Objects/genericaliasobject.c @@ -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)) { |