Skip to content
Myr

Merge branch '0.10-maintenance'

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Markus Unterwaditzer · committed by Markus Unterwaditzer · parents 97c0b26, 6a6a6d8 · Browse files · 3 files+17 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+17 added−2 removed

  • tests:+12 added−0 removed
  • other:+5 added−2 removed

3 files+17 added−2 removed

modified:flask/app.py+3 added-2 removed
1767 unmodified lines
1768 try:1769 rv = handler(error, endpoint, values)1770 if rv is not None:1771 return rv1772 except BuildError as error:1773 pass1772 except BuildError as e:1773 # make error available outside except block (py3)1774 error = e17751776 # At this point we want to reraise the exception. If the error is1777 # still the same one we can reraise it with the original traceback,1778 # otherwise we raise it from here.
197 unmodified lines
modified:tests/test_basic.py+12 added
1067 unmodified lines
1068 with app.test_request_context():1069 assert flask.url_for('spam') == '/test_handler/'107010711072def test_build_error_handler_reraise():1073 app = flask.Flask(__name__)10741075 # Test a custom handler which reraises the BuildError1076 def handler_raises_build_error(error, endpoint, values):1077 raise error1078 app.url_build_error_handlers.append(handler_raises_build_error)10791080 with app.test_request_context():1081 pytest.raises(BuildError, flask.url_for, 'not.existing')108210831084def test_custom_converters():1085 from werkzeug.routing import BaseConverter10861087 class ListConverter(BaseConverter):
531 unmodified lines
modified:CHANGES+2 added
89 unmodified lines
90 correctly.91- Changed logic of before first request handlers to flip the flag after92 invoking. This will allow some uses that are potentially dangerous but93 should probably be permitted.94- Fixed Python 3 bug when a handler from `app.url_build_error_handlers`95 reraises the `BuildError`.9697Version 0.10.198--------------99
457 unmodified lines