PythonExtra/extmod
Damien George ca40eb0fda extmod/uasyncio: Delay calling Loop.call_exception_handler by 1 loop.
When a tasks raises an exception which is uncaught, and no other task
await's on that task, then an error message is printed (or a user function
called) via a call to Loop.call_exception_handler.  In CPython this call is
made when the Task object is freed (eg via reference counting) because it's
at that point that it is known that the exception that was raised will
never be handled.

MicroPython does not have reference counting and the current behaviour is
to deal with uncaught exceptions as early as possible, ie as soon as they
terminate the task.  But this can be undesirable because in certain cases
a task can start and raise an exception immediately (before any await is
executed in that task's coro) and before any other task gets a chance to
await on it to catch the exception.

This commit changes the behaviour so that tasks which end due to an
uncaught exception are scheduled one more time for execution, and if they
are not await'ed on by the next scheduling loop, then the exception handler
is called (eg the exception is printed out).

Signed-off-by: Damien George <damien@micropython.org>
2020-12-02 12:07:06 +11:00
..
axtls-include py/py.mk: Build axtls library directly from its source files. 2018-09-08 00:07:23 +10:00
btstack extmod/modbluetooth: Re-instate optional no-ringbuf modbluetooth. 2020-11-13 17:19:05 +11:00
crypto-algorithms extmod/crypto-algorithms: Add source to header and populate copyright. 2019-08-22 17:20:16 +10:00
lwip-include all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
nimble extmod/nimble/modbluetooth_nimble: Fix build when l2cap unavailable. 2020-11-24 11:57:29 +11:00
re1.5 py, extmod: Introduce and use MP_FALLTHROUGH macro. 2020-10-22 11:53:16 +02:00
uasyncio extmod/uasyncio: Delay calling Loop.call_exception_handler by 1 loop. 2020-12-02 12:07:06 +11:00
uzlib extmod/uzlib: Explicitly cast ptr-diff-expr to unsigned. 2019-12-23 00:07:03 +11:00
webrepl all: Rename "sys" module to "usys". 2020-09-04 00:10:24 +10:00
extmod.mk extmod: Disable -Wmissing-field-initializers for lfs2. 2020-10-22 11:47:36 +02:00
machine_i2c.c extmod/machine_i2c: Add init protocol method for generic I2C bindings. 2020-11-23 19:45:04 +11:00
machine_i2c.h extmod/machine_i2c: Add init protocol method for generic I2C bindings. 2020-11-23 19:45:04 +11:00
machine_mem.c extmod/machine_mem: Only allow integers in machine.memX subscript. 2020-11-13 11:13:37 +11:00
machine_mem.h all: Use the name MicroPython consistently in comments 2017-07-31 18:35:40 +10:00
machine_pinbase.c extmod/machine_pinbase: Put PinBase singleton in ROM. 2017-09-12 16:00:21 +10:00
machine_pinbase.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
machine_pulse.c esp8266: Provide custom machine_time_pulse_us that feeds soft WDT. 2019-07-01 22:53:00 +10:00
machine_pulse.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
machine_signal.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
machine_signal.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
machine_spi.c extmod/machine_spi: Remove "id" arg in SoftSPI constructor. 2020-10-01 12:57:10 +10:00
machine_spi.h ports: Support legacy soft I2C/SPI construction via id=-1 arg. 2020-10-01 12:57:10 +10:00
misc.h extmod/uos_dupterm: Add mp_uos_dupterm_poll to poll all dupterms. 2019-07-01 17:10:12 +10:00
modbluetooth.c extmod/modbluetooth: Add API for L2CAP channels. 2020-11-24 01:07:17 +11:00
modbluetooth.h extmod/modbluetooth: Add API for L2CAP channels. 2020-11-24 01:07:17 +11:00
modbtree.c extmod/modbtree: Retain reference to underlying stream so it's not GC'd. 2020-05-02 16:08:04 +10:00
modframebuf.c all: Use MP_ERROR_TEXT for all error messages. 2020-04-05 15:02:06 +10:00
modlwip.c extmod/modlwip: Fix error return for TCP recv when not connected. 2020-08-30 13:20:51 +10:00
modonewire.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
moduasyncio.c extmod/uasyncio: Delay calling Loop.call_exception_handler by 1 loop. 2020-12-02 12:07:06 +11:00
modubinascii.c all: Format code to add space after C++-style comment start. 2020-04-23 11:24:25 +10:00
moducryptolib.c all: Format code to add space after C++-style comment start. 2020-04-23 11:24:25 +10:00
moductypes.c extmod/moductypes: Fix storing to (U)INT64 arrays on 32-bit archs. 2020-11-11 22:18:24 +11:00
moduhashlib.c all: Format code to add space after C++-style comment start. 2020-04-23 11:24:25 +10:00
moduheapq.c all: Format code to add space after C++-style comment start. 2020-04-23 11:24:25 +10:00
modujson.c all: Format code to add space after C++-style comment start. 2020-04-23 11:24:25 +10:00
modurandom.c extmod/modurandom: Support urandom.seed() without an argument. 2020-10-29 14:15:16 +11:00
modure.c extmod/modure: Allow \\ in re.sub replacements. 2020-09-30 23:18:34 +10:00
moduselect.c all: Fix implicit floating point promotion. 2020-04-18 22:36:14 +10:00
modussl_axtls.c extmod/modussl_axtls: Reduce size of code that makes exception. 2020-09-11 10:22:19 +10:00
modussl_mbedtls.c extmod/modussl_mbedtls: Integrate shorter error strings. 2020-07-21 00:31:05 +10:00
modutimeq.c all: Format code to add space after C++-style comment start. 2020-04-23 11:24:25 +10:00
moduwebsocket.c all: Format code to add space after C++-style comment start. 2020-04-23 11:24:25 +10:00
moduwebsocket.h extmod/moduwebsocket: Refactor `websocket` to `uwebsocket`. 2019-02-14 00:35:45 +11:00
moduzlib.c all: Use MP_ERROR_TEXT for all error messages. 2020-04-05 15:02:06 +10:00
modwebrepl.c all: Format code to add space after C++-style comment start. 2020-04-23 11:24:25 +10:00
mpbthci.c extmod/modbluetooth: Refactor stack/hci/driver/port bindings. 2020-09-08 11:41:31 +10:00
mpbthci.h extmod/modbluetooth: Refactor stack/hci/driver/port bindings. 2020-09-08 11:41:31 +10:00
network_cyw43.c all: Format code to add space after C++-style comment start. 2020-04-23 11:24:25 +10:00
network_cyw43.h extmod: Add network-level class binding to cyw43 driver. 2019-06-03 16:47:35 +10:00
uos_dupterm.c all: Use MP_ERROR_TEXT for all error messages. 2020-04-05 15:02:06 +10:00
utime_mphal.c extmod/utime_mphal: Add generic utime.time_ns() function. 2020-10-01 14:20:42 +10:00
utime_mphal.h extmod/utime_mphal: Add generic utime.time_ns() function. 2020-10-01 14:20:42 +10:00
vfs.c extmod/vfs: Fix lookup of entry in root dir so it fails correctly. 2020-09-23 16:23:35 +10:00
vfs.h extmod/vfs: Factor out vfs mount-and-chdir helper from stm32. 2020-03-11 14:24:26 +11:00
vfs_blockdev.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
vfs_fat.c all: Rename absolute time-based functions to include "epoch". 2020-09-18 17:20:34 +10:00
vfs_fat.h extmod: Factor out block-device struct to make independent of fatfs. 2019-10-29 12:12:37 +11:00
vfs_fat_diskio.c tools/uncrustify: Enable more opts to remove space between func and '('. 2020-06-19 22:07:32 +10:00
vfs_fat_file.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
vfs_lfs.c py, extmod: Add explicit initializers for default values. 2020-10-22 11:47:36 +02:00
vfs_lfs.h extmod: Add VFS littlefs bindings. 2019-10-29 14:17:29 +11:00
vfs_lfsx.c extmod/vfs_lfs: Support mounting LFS filesystems in read-only mode. 2020-10-29 11:43:52 +11:00
vfs_lfsx_file.c extmod/vfs_lfs: Add mtime support to littlefs files. 2020-08-25 17:35:19 +10:00
vfs_posix.c extmod/vfs: Support larger integer range in VFS stat time fields. 2020-09-01 12:36:28 +10:00
vfs_posix.h extmod/vfs: Introduce a C-level VFS protocol, with fast import_stat. 2018-06-06 14:33:42 +10:00
vfs_posix_file.c all: Use MP_ERROR_TEXT for all error messages. 2020-04-05 15:02:06 +10:00
vfs_reader.c extmod/vfs_reader: Fix mp_reader_new_file to open file in "rb" mode. 2020-08-12 23:40:50 +10:00
virtpin.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
virtpin.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00