Merge branch '1.1.x'
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by David Lord · committed by David Lord · parents 008d338, ffc6884 · Browse files · 6 files·+57 added−4 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
6 files+57 added−4 removed
- tests:+12 added−0 removed
- other:+45 added−4 removed
Provenance
- Commit
901661c- Tree
c181b9d- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent 1
008d338- Parent 2
ffc6884
6 files changed+57 added−4 removed
modified:src/flask/__init__.py+2 added-1 removed
15 unmodified lines16 from werkzeug.exceptions import abort17 from werkzeug.utils import redirect18 19 from . import json20+from ._compat import json_available21 from .app import Flask22 from .app import Request23 from .app import Response24 from .blueprints import Blueprint31 unmodified lines56 from .signals import template_rendered57 from .templating import render_template58 from .templating import render_template_string59 59-__version__ = "1.1.0"60+__version__ = "1.1.1"modified:src/flask/_compat.py+30 added
111 unmodified lines112 # Backwards compatibility as proposed in PEP 0519:113 # https://www.python.org/dev/peps/pep-0519/#backwards-compatibility114 def fspath(path):115 return path.__fspath__() if hasattr(path, "__fspath__") else path116+117+118+class _DeprecatedBool(object):119+ def __init__(self, name, version, value):120+ self.message = "'{}' is deprecated and will be removed in version {}.".format(121+ name, version122+ )123+ self.value = value124+125+ def _warn(self):126+ import warnings127+128+ warnings.warn(self.message, DeprecationWarning, stacklevel=2)129+130+ def __eq__(self, other):131+ self._warn()132+ return other == self.value133+134+ def __ne__(self, other):135+ self._warn()136+ return other != self.value137+138+ def __bool__(self):139+ self._warn()140+ return self.value141+142+ __nonzero__ = __bool__143+144+145+json_available = _DeprecatedBool("flask.json_available", "2.0.0", True)added:tests/test_deprecations.py+12 added
1+import pytest2+3+from flask import json_available4+5+6+def test_json_available():7+ with pytest.deprecated_call() as rec:8+ assert json_available9+ assert json_available == True # noqa E71210+ assert json_available != False # noqa E71211+12+ assert len(rec.list) == 3modified:CHANGES.rst+10 added
1 .. currentmodule:: flask2 3+Version 1.1.14+-------------5+6+Released 2019-07-087+8+- The ``flask.json_available`` flag was added back for compatibility9+ with some extensions. It will raise a deprecation warning when used,10+ and will be removed in version 2.0.0. :issue:`3288`11+12+13 Version 1.1.014 -------------15 16 Released 2019-07-04983 unmodified linesmodified:README.rst+2 added-2 removed
64 unmodified lines65 66 Links67 -----68 69-* Website: https://www.palletsprojects.com/p/flask/70-* Documentation: http://flask.pocoo.org/docs/69+* Website: https://palletsprojects.com/p/flask/70+* Documentation: https://flask.palletsprojects.com/71 * Releases: https://pypi.org/project/Flask/72 * Code: https://github.com/pallets/flask73 * Issue tracker: https://github.com/pallets/flask/issues74 * Test status: https://dev.azure.com/pallets/flask/_build6 unmodified linesmodified:setup.py+1 added-1 removed
13 unmodified lines14 name="Flask",15 version=version,16 url="https://palletsprojects.com/p/flask/",17 project_urls={18- "Documentation": "http://flask.palletsprojects.com/",18+ "Documentation": "https://flask.palletsprojects.com/",19 "Code": "https://github.com/pallets/flask",20 "Issue tracker": "https://github.com/pallets/flask/issues",21 },22 license="BSD-3-Clause",55 unmodified lines