Skip to content
Myr

remove deprecated RequestContext.g

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 · parent 96d39c8 · Browse files · 2 files+4 added−26 removed
This commit

State

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

Diff stats

2 files+4 added−26 removed

  • other:+4 added−26 removed

2 files+4 added−26 removed

modified:src/flask/ctx.py-26 removed
325 unmodified lines
326 # object. These will be called before the regular "after_request"327 # functions.328 self._after_request_functions: t.List[ft.AfterRequestCallable] = []329330 @property331 def g(self) -> _AppCtxGlobals:332 import warnings333334 warnings.warn(335 "Accessing 'g' on the request context is deprecated and"336 " will be removed in Flask 2.2. Access `g` directly or from"337 "the application context instead.",338 DeprecationWarning,339 stacklevel=2,340 )341 return _app_ctx_stack.top.g342343 @g.setter344 def g(self, value: _AppCtxGlobals) -> None:345 import warnings346347 warnings.warn(348 "Setting 'g' on the request context is deprecated and"349 " will be removed in Flask 2.2. Set it on the application"350 " context instead.",351 DeprecationWarning,352 stacklevel=2,353 )354 _app_ctx_stack.top.g = value355330 def copy(self) -> "RequestContext":331 """Creates a copy of this request context with the same request object.332 This can be used to move a request context to a different greenlet.333 Because the actual request object is the same this cannot be used to
123 unmodified lines
modified:CHANGES.rst+4 added
3 unmodified lines
4-------------56Unreleased78- Remove previously deprecated code. :pr:`4337`910 - The ``RequestContext.g`` proxy to ``AppContext.g`` is removed.1112- Add new customization points to the ``Flask`` app object for many13 previously global behaviors.1415 - ``flask.url_for`` will call ``app.url_for``. :issue:`4568`
1340 unmodified lines