Skip to content

Commit aa7e15d

Browse files
committed
Reduce unnecessary function calls.
When propagate exceptions, the function call of "_find_error_handler" makes no sense.
1 parent 0b7a74d commit aa7e15d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

flask/app.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1728,9 +1728,7 @@ def handle_exception(self, e):
17281728
.. versionadded:: 0.3
17291729
"""
17301730
exc_type, exc_value, tb = sys.exc_info()
1731-
17321731
got_request_exception.send(self, exception=e)
1733-
handler = self._find_error_handler(InternalServerError())
17341732

17351733
if self.propagate_exceptions:
17361734
# if we want to repropagate the exception, we can attempt to
@@ -1743,6 +1741,7 @@ def handle_exception(self, e):
17431741
raise e
17441742

17451743
self.log_exception((exc_type, exc_value, tb))
1744+
handler = self._find_error_handler(InternalServerError())
17461745
if handler is None:
17471746
return InternalServerError()
17481747
return self.finalize_request(handler(e), from_error_handler=True)

0 commit comments

Comments
 (0)