From aa7e15dcbab208ca404bcecd94cbe6fc583150dc Mon Sep 17 00:00:00 2001 From: garenchan <1412950785@qq.com> Date: Wed, 19 Sep 2018 10:39:56 +0800 Subject: [PATCH] Reduce unnecessary function calls. When propagate exceptions, the function call of "_find_error_handler" makes no sense. --- flask/app.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/flask/app.py b/flask/app.py index 87c59003..77852320 100644 --- a/flask/app.py +++ b/flask/app.py @@ -1728,9 +1728,7 @@ class Flask(_PackageBoundObject): .. versionadded:: 0.3 """ exc_type, exc_value, tb = sys.exc_info() - got_request_exception.send(self, exception=e) - handler = self._find_error_handler(InternalServerError()) if self.propagate_exceptions: # if we want to repropagate the exception, we can attempt to @@ -1743,6 +1741,7 @@ class Flask(_PackageBoundObject): raise e self.log_exception((exc_type, exc_value, tb)) + handler = self._find_error_handler(InternalServerError()) if handler is None: return InternalServerError() return self.finalize_request(handler(e), from_error_handler=True)