summaryrefslogtreecommitdiffstatshomepage
path: root/esp8266/modesp.c
diff options
context:
space:
mode:
authorJavier Candeira <javier@candeira.com>2017-08-09 14:40:45 +1000
committerJavier Candeira <javier@candeira.com>2017-08-13 22:52:33 +1000
commit35a1fea90b2cae9d5cc8e9eab62ba4c67e8786db (patch)
tree26616de189a9154309287846bf76fb1cdab8ce51 /esp8266/modesp.c
parentb6a328956467339f568b19d9192fbbfdfa47a572 (diff)
downloadmicropython-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 'esp8266/modesp.c')
-rw-r--r--esp8266/modesp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/esp8266/modesp.c b/esp8266/modesp.c
index a63d505645..6ddca0733b 100644
--- a/esp8266/modesp.c
+++ b/esp8266/modesp.c
@@ -118,7 +118,7 @@ STATIC mp_obj_t esp_flash_write(mp_obj_t offset_in, const mp_obj_t buf_in) {
mp_buffer_info_t bufinfo;
mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ);
if (bufinfo.len & 0x3) {
- nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "len must be multiple of 4"));
+ mp_raise_ValueError("len must be multiple of 4");
}
SpiFlashOpResult res = spi_flash_write(offset, bufinfo.buf, bufinfo.len);
if (res == SPI_FLASH_RESULT_OK) {