diff options
author | Javier Candeira <javier@candeira.com> | 2017-08-09 14:40:45 +1000 |
---|---|---|
committer | Javier Candeira <javier@candeira.com> | 2017-08-13 22:52:33 +1000 |
commit | 35a1fea90b2cae9d5cc8e9eab62ba4c67e8786db (patch) | |
tree | 26616de189a9154309287846bf76fb1cdab8ce51 /stmhal/rtc.c | |
parent | b6a328956467339f568b19d9192fbbfdfa47a572 (diff) | |
download | micropython-35a1fea90b2cae9d5cc8e9eab62ba4c67e8786db.tar.gz micropython-35a1fea90b2cae9d5cc8e9eab62ba4c67e8786db.zip |
all: Raise exceptions via mp_raise_XXX
- Changed: ValueError, TypeError, NotImplementedError
- OSError invocations unchanged, because the corresponding utility
function takes ints, not strings like the long form invocation.
- OverflowError, IndexError and RuntimeError etc. not changed for now
until we decide whether to add new utility functions.
Diffstat (limited to 'stmhal/rtc.c')
-rw-r--r-- | stmhal/rtc.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/stmhal/rtc.c b/stmhal/rtc.c index 4efc56d5c8..6cb6ef047e 100644 --- a/stmhal/rtc.c +++ b/stmhal/rtc.c @@ -575,7 +575,7 @@ mp_obj_t pyb_rtc_wakeup(mp_uint_t n_args, const mp_obj_t *args) { wut -= 0x10000; if (wut > 0x10000) { // wut still too large - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "wakeup value too large")); + mp_raise_ValueError("wakeup value too large"); } } } @@ -685,12 +685,10 @@ mp_obj_t pyb_rtc_calibration(mp_uint_t n_args, const mp_obj_t *args) { } return mp_obj_new_int(cal & 1); } else { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, - "calibration value out of range")); + mp_raise_ValueError("calibration value out of range"); } #else - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, - "calibration value out of range")); + mp_raise_ValueError("calibration value out of range"); #endif } if (cal > 0) { |