evaluate lambda keyword-only defaults after positional defaults (#16967 again)

This commit is contained in:
Benjamin Peterson 2013-02-10 09:48:22 -05:00
parent 8b466c9932
commit 419d9a83d5
4 changed files with 9 additions and 5 deletions

View file

@ -1794,14 +1794,14 @@ compiler_lambda(struct compiler *c, expr_ty e)
return 0;
}
if (args->defaults)
VISIT_SEQ(c, expr, args->defaults);
if (args->kwonlyargs) {
int res = compiler_visit_kwonlydefaults(c, args->kwonlyargs,
args->kw_defaults);
if (res < 0) return 0;
kw_default_count = res;
}
if (args->defaults)
VISIT_SEQ(c, expr, args->defaults);
if (!compiler_enter_scope(c, name, COMPILER_SCOPE_FUNCTION,
(void *)e, e->lineno))
return 0;