summaryrefslogtreecommitdiff
path: root/py/compile.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-03-26 23:09:14 +0000
committerDamien George <damien.p.george@gmail.com>2014-03-26 23:09:14 +0000
commitd6f94340916bc5eabcf51d7afea523885adce818 (patch)
treebc59b126181dcf37868b72f5edbb6e74c1b0c1f3 /py/compile.c
parenteed6f26bed82969e3c9954159b17fe2733f4cb42 (diff)
parent2447a5b582503b70936681702062704e2e9f44d3 (diff)
Merge pull request #381 from pfalcon/closure-defargs
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;