Skip to content

Commit 966583c

Browse files
committed
ignore more errors when trying to set hooks
1 parent 492ea3b commit 966583c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

alive_progress/core/hook_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ def get_all_loggers():
9090
def set_hook(h):
9191
try:
9292
return h.setStream(get_hook_for(h))
93-
except AttributeError:
94-
pass # ignores errors and return None
93+
except Exception: # captures AttributeError, AssertionError, and anything else,
94+
pass # then returns None, effectively leaving that handler alone, unchanged.
9595

9696
# account for reused handlers within loggers.
9797
handlers = set(h for logger in get_all_loggers()

0 commit comments

Comments
 (0)