def call(
self,
hookname: str,
*args: object,
) -> None:
# snip
for instrument in list(self.data[hookname]):
try:
getattr(instrument, hookname)(*args)
except BaseException: # E
self.remove_instrument(instrument)
INSTRUMENT_LOGGER.exception(
"Exception raised when calling %r on instrument %r. "
"Instrument has been disabled.",
hookname,
instrument,
)
src/trio/_core/_instrumentation.py:110:20: ASYNC103 BaseException block with a code path that doesn't re-raise the error. Consider adding an `except trio.Cancelled: raise` before this exception handler.
I don't think sync functions can raise
trio.Cancelled, but this is causing ASYNC103:Error message: