Merge pull request #1002 from openmv/unav_fix

Make py_func_unavailable handle no args.
This commit is contained in:
Ibrahim Abd Elkader 2020-11-25 21:42:02 +02:00 committed by GitHub
commit 080c5eae71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,9 +16,9 @@ extern void *py_image_cobj(mp_obj_t img_obj);
mp_obj_t py_func_unavailable(uint n_args, const mp_obj_t *args, mp_map_t *kw_args)
{
PY_ASSERT_TRUE_MSG(false, "This function is unavailable on your OpenMV Cam.");
return args[0];
return mp_const_none;
}
MP_DEFINE_CONST_FUN_OBJ_KW(py_func_unavailable_obj, 1, py_func_unavailable);
MP_DEFINE_CONST_FUN_OBJ_KW(py_func_unavailable_obj, 0, py_func_unavailable);
image_t *py_helper_arg_to_image_mutable(const mp_obj_t arg)
{