diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2015-07-22 11:48:57 (GMT) |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2015-07-22 11:48:57 (GMT) |
commit | b7666a30933efbbb2e400e6916bba2311340fcd1 (patch) | |
tree | cee7b9199e082b014a9cbcbe749aa86591cad829 /Python | |
parent | 8fb307cd650511ba019c4493275cb6684ad308bc (diff) | |
download | cpython-b7666a30933efbbb2e400e6916bba2311340fcd1.zip cpython-b7666a30933efbbb2e400e6916bba2311340fcd1.tar.gz cpython-b7666a30933efbbb2e400e6916bba2311340fcd1.tar.bz2 |
Issue #24619: More tests; fix nits in compiler.c
Diffstat (limited to 'Python')
-rw-r--r-- | Python/compile.c | 5 | ||||
-rw-r--r-- | Python/symtable.c | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/Python/compile.c b/Python/compile.c index 2202e8f..33cc8c2 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -1749,13 +1749,12 @@ compiler_function(struct compiler *c, stmt_ty s, int is_async) arglength = asdl_seq_LEN(args->defaults); arglength |= kw_default_count << 8; arglength |= num_annotations << 16; + if (is_async) + co->co_flags |= CO_COROUTINE; compiler_make_closure(c, co, arglength, qualname); Py_DECREF(qualname); Py_DECREF(co); - if (is_async) - co->co_flags |= CO_COROUTINE; - /* decorators */ for (i = 0; i < asdl_seq_LEN(decos); i++) { ADDOP_I(c, CALL_FUNCTION, 1); diff --git a/Python/symtable.c b/Python/symtable.c index 354b799..64910d8 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -1542,7 +1542,7 @@ symtable_visit_annotations(struct symtable *st, stmt_ty s, if (a->kwonlyargs && !symtable_visit_argannotations(st, a->kwonlyargs)) return 0; if (returns) - VISIT(st, expr, s->v.FunctionDef.returns); + VISIT(st, expr, returns); return 1; } |