restore and deprecate json_available #3292
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
flask.json_available
was removed because it was marked deprecated in the code and doesn't do anything.flask.json
is always available, and libaries that weren't sure about that should have usedtry/except ImportError
while it was relevant. However, since a few dormant but popular extensions use it, it's added back in for now.Anything doing
if json_available
orif json_available == True
, such as Flask-Testing and Flask-DebugToolbar, will show aDeprecationWarning
.is
can't be overridden, so that won't show a warning, but I don't think things that were using this flag did that.I've marked it for removal in 2.0.0, which will be a pretty big change anyway. Please reach out to extensions you use if you see this warning and offer to help maintain it if it's an extension you want to continue using as Flask moves forward.
closes #3288