summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--py/objfun.c6
-rwxr-xr-xtests/run-tests.py5
2 files changed, 4 insertions, 7 deletions
diff --git a/py/objfun.c b/py/objfun.c
index 31f4a1f83..992c8c784 100644
--- a/py/objfun.c
+++ b/py/objfun.c
@@ -139,14 +139,14 @@ STATIC qstr mp_obj_code_get_name(const mp_obj_fun_bc_t *fun, const byte *code_in
qstr mp_obj_fun_get_name(mp_const_obj_t fun_in) {
const mp_obj_fun_bc_t *fun = MP_OBJ_TO_PTR(fun_in);
+ const byte *bc = fun->bytecode;
+
#if MICROPY_EMIT_NATIVE
if (fun->base.type == &mp_type_fun_native || fun->base.type == &mp_type_native_gen_wrap) {
- // TODO native functions don't have name stored
- return MP_QSTR_;
+ bc = mp_obj_fun_native_get_prelude_ptr(fun);
}
#endif
- const byte *bc = fun->bytecode;
MP_BC_PRELUDE_SIG_DECODE(bc);
return mp_obj_code_get_name(fun, bc);
}
diff --git a/tests/run-tests.py b/tests/run-tests.py
index ba66eced4..70279d379 100755
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -643,9 +643,7 @@ def run_tests(pyb, tests, args, result_dir, num_threads=1):
# Some tests are known to fail with native emitter
# Remove them from the below when they work
if args.emit == "native":
- skip_tests.update(
- {"basics/%s.py" % t for t in "gen_yield_from_close generator_name".split()}
- ) # require raise_varargs, generator name
+ skip_tests.add("basics/gen_yield_from_close.py") # require raise_varargs
skip_tests.update(
{"basics/async_%s.py" % t for t in "with with2 with_break with_return".split()}
) # require async_with
@@ -656,7 +654,6 @@ def run_tests(pyb, tests, args, result_dir, num_threads=1):
skip_tests.add("basics/del_deref.py") # requires checking for unbound local
skip_tests.add("basics/del_local.py") # requires checking for unbound local
skip_tests.add("basics/exception_chain.py") # raise from is not supported
- skip_tests.add("basics/fun_name.py") # requires proper names for native functions
skip_tests.add("basics/scope_implicit.py") # requires checking for unbound local
skip_tests.add("basics/sys_tracebacklimit.py") # requires traceback info
skip_tests.add("basics/try_finally_return2.py") # requires raise_varargs