Improve check in ExceptionsFilter

This commit is contained in:
Suren Khorenyan 2018-06-07 23:38:23 +03:00
parent c88ee7ed52
commit 99bb5a9fef

View file

@ -238,12 +238,7 @@ class ExceptionsFilter(Filter):
self.exception = exception
def check(self, dispatcher, update, exception):
try:
raise exception
except self.exception:
return True
except:
return False
return isinstance(exception, self.exception)
def generate_default_filters(dispatcher, *args, **kwargs):