Skip to content

Commit

Permalink
Revert "Handle BaseExceptions (pallets#2222)"
Browse files Browse the repository at this point in the history
This reverts commit 1d4448a.
  • Loading branch information
untitaker committed Mar 31, 2017
1 parent 1d4448a commit c935eac
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 23 deletions.
3 changes: 0 additions & 3 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ Major release, unreleased
- Change default configuration `JSONIFY_PRETTYPRINT_REGULAR=False`. jsonify()
method returns compressed response by default, and pretty response in
debug mode.
- Call `ctx.auto_pop` with the exception object instead of `None`, in the
event that a `BaseException` such as `KeyboardInterrupt` is raised in a
request handler.

Version 0.12.1
--------------
Expand Down
3 changes: 0 additions & 3 deletions flask/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1991,9 +1991,6 @@ def wsgi_app(self, environ, start_response):
except Exception as e:
error = e
response = self.handle_exception(e)
except:
error = sys.exc_info()[1]
raise
return response(environ, start_response)
finally:
if self.should_ignore_error(error):
Expand Down
17 changes: 0 additions & 17 deletions tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,23 +791,6 @@ def after_request(resp):
assert resp.data == b'internal server error'


def test_baseexception_error_handling():
app = flask.Flask(__name__)
app.config['LOGGER_HANDLER_POLICY'] = 'never'

@app.route('/')
def broken_func():
raise KeyboardInterrupt()

with app.test_client() as c:
with pytest.raises(KeyboardInterrupt):
c.get('/')

ctx = flask._request_ctx_stack.top
assert ctx.preserved
assert type(ctx._preserved_exc) is KeyboardInterrupt


def test_before_request_and_routing_errors():
app = flask.Flask(__name__)

Expand Down

0 comments on commit c935eac

Please sign in to comment.