Skip to content

Commit 54ff754

Browse files
committed
py/emitglue.c: add is_async
1 parent ffaabeb commit 54ff754

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

py/emitglue.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ void mp_emit_glue_assign_bytecode(mp_raw_code_t *rc, const byte *code,
7272

7373
rc->kind = MP_CODE_BYTECODE;
7474
rc->is_generator = (scope_flags & MP_SCOPE_FLAG_GENERATOR) != 0;
75+
// CIRCUITPY-CHANGE: async and generator are distinguished
7576
rc->is_async = (scope_flags & MP_SCOPE_FLAG_ASYNC) != 0;
7677
rc->fun_data = code;
7778
rc->children = children;
@@ -135,6 +136,7 @@ void mp_emit_glue_assign_native(mp_raw_code_t *rc, mp_raw_code_kind_t kind, cons
135136

136137
rc->kind = kind;
137138
rc->is_generator = (scope_flags & MP_SCOPE_FLAG_GENERATOR) != 0;
139+
// CIRCUITPY-CHANGE: async and generator are distinguished
138140
rc->is_async = (scope_flags & MP_SCOPE_FLAG_ASYNC) != 0;
139141
rc->fun_data = fun_data;
140142

@@ -205,7 +207,6 @@ mp_obj_t mp_make_function_from_proto_fun(mp_proto_fun_t proto_fun, const mp_modu
205207
switch (rc->kind) {
206208
#if MICROPY_EMIT_NATIVE
207209
case MP_CODE_NATIVE_PY:
208-
case MP_CODE_NATIVE_VIPER:
209210
fun = mp_obj_new_fun_native(def_args, rc->fun_data, context, rc->children);
210211
// Check for a generator function, and if so change the type of the object
211212
// CIRCUITPY-CHANGE: distinguish generators and async

0 commit comments

Comments
 (0)