gh-105879: Add support for keyword arguments to eval and exec (#105885)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
Raphael Gaschignard 2024-05-03 01:55:29 +10:00 committed by GitHub
parent 72867c962c
commit 2770d5caca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 98 additions and 33 deletions

View file

@ -925,9 +925,9 @@ builtin_divmod_impl(PyObject *module, PyObject *x, PyObject *y)
eval as builtin_eval
source: object
/
globals: object = None
locals: object = None
/
Evaluate the given source in the context of globals and locals.
@ -941,7 +941,7 @@ If only globals is given, locals defaults to it.
static PyObject *
builtin_eval_impl(PyObject *module, PyObject *source, PyObject *globals,
PyObject *locals)
/*[clinic end generated code: output=0a0824aa70093116 input=11ee718a8640e527]*/
/*[clinic end generated code: output=0a0824aa70093116 input=7c7bce5299a89062]*/
{
PyObject *result = NULL, *source_copy;
const char *str;
@ -1024,9 +1024,9 @@ builtin_eval_impl(PyObject *module, PyObject *source, PyObject *globals,
exec as builtin_exec
source: object
/
globals: object = None
locals: object = None
/
*
closure: object(c_default="NULL") = None
@ -1044,7 +1044,7 @@ when source is a code object requiring exactly that many cellvars.
static PyObject *
builtin_exec_impl(PyObject *module, PyObject *source, PyObject *globals,
PyObject *locals, PyObject *closure)
/*[clinic end generated code: output=7579eb4e7646743d input=f13a7e2b503d1d9a]*/
/*[clinic end generated code: output=7579eb4e7646743d input=25e989b6d87a3a21]*/
{
PyObject *v;