summaryrefslogtreecommitdiffstats
path: root/Python/ast.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/ast.c')
-rw-r--r--Python/ast.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Python/ast.c b/Python/ast.c
index 8b356fe..c1ce0aa 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -199,8 +199,10 @@ validate_expr(expr_ty exp, expr_context_ty ctx)
"Dict doesn't have the same number of keys as values");
return 0;
}
- return validate_exprs(exp->v.Dict.keys, Load, 0) &&
- validate_exprs(exp->v.Dict.values, Load, 0);
+ /* null_ok=1 for keys expressions to allow dict unpacking to work in
+ dict literals, i.e. ``{**{a:b}}`` */
+ return validate_exprs(exp->v.Dict.keys, Load, /*null_ok=*/ 1) &&
+ validate_exprs(exp->v.Dict.values, Load, /*null_ok=*/ 0);
case Set_kind:
return validate_exprs(exp->v.Set.elts, Load, 0);
#define COMP(NAME) \