diff --git a/CHANGES.rst b/CHANGES.rst index cc96f441..c4d6b044 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,6 +5,10 @@ Version 2.2.0 Unreleased +- Remove previously deprecated code. :pr:`4337` + + - The ``RequestContext.g`` proxy to ``AppContext.g`` is removed. + - Add new customization points to the ``Flask`` app object for many previously global behaviors. diff --git a/src/flask/ctx.py b/src/flask/ctx.py index caecbcc2..dc1f23b3 100644 --- a/src/flask/ctx.py +++ b/src/flask/ctx.py @@ -327,32 +327,6 @@ class RequestContext: # functions. self._after_request_functions: t.List[ft.AfterRequestCallable] = [] - @property - def g(self) -> _AppCtxGlobals: - import warnings - - warnings.warn( - "Accessing 'g' on the request context is deprecated and" - " will be removed in Flask 2.2. Access `g` directly or from" - "the application context instead.", - DeprecationWarning, - stacklevel=2, - ) - return _app_ctx_stack.top.g - - @g.setter - def g(self, value: _AppCtxGlobals) -> None: - import warnings - - warnings.warn( - "Setting 'g' on the request context is deprecated and" - " will be removed in Flask 2.2. Set it on the application" - " context instead.", - DeprecationWarning, - stacklevel=2, - ) - _app_ctx_stack.top.g = value - def copy(self) -> "RequestContext": """Creates a copy of this request context with the same request object. This can be used to move a request context to a different greenlet.