diff options
| author | Dan Halbert <halbert@halwitz.org> | 2020-07-28 14:15:02 -0400 |
|---|---|---|
| committer | Dan Halbert <halbert@halwitz.org> | 2020-07-28 14:15:02 -0400 |
| commit | aa97ea25016c60edf688b51f6495f8fbd740cc8e (patch) | |
| tree | f5b24b64a8f55f0e940e2aabb947e2825729c6e9 /py | |
| parent | e5e132a36436aa5aa0a6124b28edd44536fc38c7 (diff) | |
| parent | 9fc7118861a118b9e0a7e37b6bc902654ee11401 (diff) | |
Merge remote-tracking branch 'adafruit/main' into blm_badge
Diffstat (limited to 'py')
| -rw-r--r-- | py/circuitpy_mpconfig.h | 2 | ||||
| -rw-r--r-- | py/compile.c | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index a1a7ec238..255ab99b9 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -799,7 +799,7 @@ void supervisor_run_background_tasks_if_tick(void); #endif #ifndef CIRCUITPY_PYSTACK_SIZE -#define CIRCUITPY_PYSTACK_SIZE 1024 +#define CIRCUITPY_PYSTACK_SIZE 1536 #endif #define CIRCUITPY_BOOT_OUTPUT_FILE "/boot_out.txt" diff --git a/py/compile.c b/py/compile.c index 9b0d29998..fade4c01a 100644 --- a/py/compile.c +++ b/py/compile.c @@ -1713,11 +1713,11 @@ STATIC void compile_yield_from(compiler_t *comp) { #if MICROPY_PY_ASYNC_AWAIT STATIC bool compile_require_async_context(compiler_t *comp, mp_parse_node_struct_t *pns) { int scope_flags = comp->scope_cur->scope_flags; - if(scope_flags & MP_SCOPE_FLAG_GENERATOR) { + if(scope_flags & MP_SCOPE_FLAG_ASYNC) { return true; } compile_syntax_error(comp, (mp_parse_node_t)pns, - translate("'async for' or 'async with' outside async function")); + translate("'await', 'async for' or 'async with' outside async function")); return false; } @@ -2645,6 +2645,7 @@ STATIC void compile_atom_expr_await(compiler_t *comp, mp_parse_node_struct_t *pn compile_syntax_error(comp, (mp_parse_node_t)pns, translate("'await' outside function")); return; } + compile_require_async_context(comp, pns); compile_atom_expr_normal(comp, pns); compile_yield_from(comp); } |
