Issue #13343: Fix a SystemError when a lambda expression uses a global

variable in the default value of a keyword-only argument:
(lambda *, arg=GLOBAL_NAME: None)
This commit is contained in:
Amaury Forgeot d'Arc 2011-11-04 22:17:45 +01:00
parent 3c85fe07f4
commit 97c1bef6a4
3 changed files with 15 additions and 0 deletions

View file

@ -1334,6 +1334,9 @@ symtable_visit_expr(struct symtable *st, expr_ty e)
return 0;
if (e->v.Lambda.args->defaults)
VISIT_SEQ(st, expr, e->v.Lambda.args->defaults);
if (e->v.Lambda.args->kw_defaults)
VISIT_KWONLYDEFAULTS(st,
e->v.Lambda.args->kw_defaults);
if (!symtable_enter_block(st, lambda,
FunctionBlock, (void *)e, e->lineno,
e->col_offset))