summaryrefslogtreecommitdiff
path: root/py/compile.c
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-03-26 23:14:59 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-03-26 23:17:44 +0200
commit2447a5b582503b70936681702062704e2e9f44d3 (patch)
tree6f747fe74cc8400df1a23a74cbb0b9034df5bc60 /py/compile.c
parentc12b2213c16ba8839981c362c4d5f133a84b374b (diff)
py: Support closures with default args.
Diffstat (limited to 'py/compile.c')
-rw-r--r--py/compile.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/py/compile.c b/py/compile.c
index 0a10b8176..dc001cd88 100644
--- a/py/compile.c
+++ b/py/compile.c
@@ -766,6 +766,9 @@ void c_assign(compiler_t *comp, mp_parse_node_t pn, assign_kind_t assign_kind) {
// 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;