Fix constant folding optimization for positional only arguments (GH-17837)
(cherry picked from commit b121a4a45ff4bab8812a9b26ceffe5ad642f5d5a)
Co-authored-by: Anthony Sottile <asottile@umich.edu>
diff --git a/Python/ast_opt.c b/Python/ast_opt.c
index 96c766f..f2a2c25 100644
--- a/Python/ast_opt.c
+++ b/Python/ast_opt.c
@@ -617,6 +617,7 @@
static int
astfold_arguments(arguments_ty node_, PyArena *ctx_, int optimize_)
{
+ CALL_SEQ(astfold_arg, arg_ty, node_->posonlyargs);
CALL_SEQ(astfold_arg, arg_ty, node_->args);
CALL_OPT(astfold_arg, arg_ty, node_->vararg);
CALL_SEQ(astfold_arg, arg_ty, node_->kwonlyargs);