summaryrefslogtreecommitdiff
path: root/Python/compile.c
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2015-07-22 14:48:57 +0300
committerYury Selivanov <yselivanov@sprymix.com>2015-07-22 14:48:57 +0300
commit0d0c1f7adb3accb5352012a42ecc68587a10e683 (patch)
tree290fdc8e22a294dd6329d9a7d7a8b0c677f0152f /Python/compile.c
parent35c1e53a87bc711efc72fcdd5ce25b9f124ab563 (diff)
downloadcpython-0d0c1f7adb3accb5352012a42ecc68587a10e683.tar.gz
Issue #24619: More tests; fix nits in compiler.c
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 2202e8f3a1..33cc8c22cb 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);