From 011c096e9604bdb55890d7e41180165894e29d5e Mon Sep 17 00:00:00 2001 From: Matteo Campinoti Date: Tue, 21 Nov 2023 12:38:11 +0100 Subject: [PATCH] utils:helpers - ExceptionManager always catches explicitly declared exceptions --- acacore/utils/helpers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/acacore/utils/helpers.py b/acacore/utils/helpers.py index 9287919..24cb50f 100644 --- a/acacore/utils/helpers.py +++ b/acacore/utils/helpers.py @@ -41,4 +41,6 @@ def __exit__( if not exc_type: return False - return any(issubclass(exc_type, e) for e in self.catch) and not any(issubclass(exc_type, e) for e in self.allow) + return any(issubclass(exc_type, e) for e in self.catch) and ( + exc_type in self.catch or not any(issubclass(exc_type, e) for e in self.allow) + )