Don't handle BaseException
#3880
Labels
category:codebase:scheduler
relating to cocotb's coroutine scheduler, triggers, and coroutine objects
type:feature
new or enhanced functionality
There are several places in the cocotb codebase that handle
BaseException
s and do stuff to them/squash them ("manage" them). This is not ideal. Instead we should be catching onlyException
and selectBaseException
s that are safe to catch, for example:AssertionError
andpytest.Failed
.Places where this unsafe handling occurs:
cocotb/src/cocotb/_scheduler.py
Line 537 in 102625f
cocotb/src/cocotb/_outcomes.py
Line 18 in 102625f
cocotb/src/cocotb/task.py
Line 137 in 102625f
cocotb/src/cocotb/triggers.py
Line 809 in 102625f
I suggest we move the
pytest.Failed
logic fromcocotb.regression
intococotb._conf
and setup a variable which will include allException
types that should be caught in these circumstances.Closing #3787 and #3788 would help shrink that list and not create some potentially weird cyclic reference between
cocotb._conf
andcocotb.result
.The text was updated successfully, but these errors were encountered: