diff --git a/src/omv/py/py_assert.h b/src/omv/py/py_assert.h index f73d747a4..38dc8eeb4 100644 --- a/src/omv/py/py_assert.h +++ b/src/omv/py/py_assert.h @@ -17,6 +17,14 @@ } \ } while(0) +#define PY_ASSERT_TRUE_MSG(cond, msg) \ + do { \ + if ((cond) ==0){ \ + nlr_jump(mp_obj_new_exception_msg( \ + &mp_type_OSError, msg)); \ + } \ + } while(0) + #define PY_ASSERT_TYPE(obj, type) \ do { \ __typeof__ (obj) _a = (obj); \