diff options
| author | Damien George | 2018-05-03 00:09:25 +1000 |
|---|---|---|
| committer | Damien George | 2018-05-03 00:09:25 +1000 |
| commit | 12a3fccc7e07124afd8634353baa2a2a32a04c8d (patch) | |
| tree | b5385db5a265bb55efcd54ce1328abe344c87927 | |
| parent | 59361681501cda2aa998fda649929591308aaebb (diff) | |
esp32/modsocket: Check for pending events during blocking socket calls.
| -rw-r--r-- | ports/esp32/modsocket.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/ports/esp32/modsocket.c b/ports/esp32/modsocket.c index 1bac4432f..daa77f581 100644 --- a/ports/esp32/modsocket.c +++ b/ports/esp32/modsocket.c @@ -146,12 +146,8 @@ NORETURN static void exception_from_errno(int _errno) { mp_raise_OSError(_errno); } -void check_for_exceptions() { - mp_obj_t exc = MP_STATE_VM(mp_pending_exception); - if (exc != MP_OBJ_NULL) { - MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL; - nlr_raise(exc); - } +static inline void check_for_exceptions(void) { + mp_handle_pending(); } static int _socket_getaddrinfo2(const mp_obj_t host, const mp_obj_t portx, struct addrinfo **resp) { |
