py: Support closures with default args.
diff --git a/py/compile.c b/py/compile.c
index 0a10b81..dc001cd 100644
--- a/py/compile.c
+++ b/py/compile.c
@@ -766,6 +766,9 @@
// stuff for lambda and comprehensions and generators
void close_over_variables_etc(compiler_t *comp, scope_t *this_scope, int n_dict_params, int n_default_params) {
+ if (n_default_params) {
+ EMIT_ARG(build_tuple, n_default_params);
+ }
// make closed over variables, if any
// ensure they are closed over in the order defined in the outer scope (mainly to agree with CPython)
int nfree = 0;