Make sure that keyword arguments are merged into the arguments dictionary when dict unpacking and keyword arguments are interleaved. (GH-20553) (GH-20569)
(cherry picked from commit db64f12e4deda2abbafb6d2bd5c06762fca991ff)
Co-authored-by: Mark Shannon <mark@hotpy.org>
diff --git a/Python/compile.c b/Python/compile.c
index 4a587c0..fccc688 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -4321,6 +4321,9 @@
if (!compiler_subkwargs(c, keywords, i - nseen, i)) {
return 0;
}
+ if (have_dict) {
+ ADDOP_I(c, DICT_MERGE, 1);
+ }
have_dict = 1;
nseen = 0;
}