[pre-commit.ci lite] apply automatic fixes
This commit is contained in:
parent
aa37c0a145
commit
21e094d696
1 changed files with 7 additions and 6 deletions
|
|
@ -3,12 +3,11 @@ from __future__ import annotations
|
||||||
import contextvars
|
import contextvars
|
||||||
import sys
|
import sys
|
||||||
import typing as t
|
import typing as t
|
||||||
|
import warnings
|
||||||
from functools import update_wrapper
|
from functools import update_wrapper
|
||||||
from types import TracebackType
|
from types import TracebackType
|
||||||
import warnings
|
from typing import cast
|
||||||
from typing import Optional, Union, cast
|
from typing import Optional
|
||||||
|
|
||||||
from werkzeug.exceptions import HTTPException
|
|
||||||
|
|
||||||
from . import typing as ft
|
from . import typing as ft
|
||||||
from .globals import _cv_app
|
from .globals import _cv_app
|
||||||
|
|
@ -29,7 +28,9 @@ if t.TYPE_CHECKING: # pragma: no cover
|
||||||
_sentinel = object()
|
_sentinel = object()
|
||||||
|
|
||||||
# Context variable for the new unified context
|
# Context variable for the new unified context
|
||||||
_cv_execution = contextvars.ContextVar[Optional["ExecutionContext"]]("flask.execution_ctx")
|
_cv_execution = contextvars.ContextVar[Optional["ExecutionContext"]](
|
||||||
|
"flask.execution_ctx"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class _AppCtxGlobals:
|
class _AppCtxGlobals:
|
||||||
|
|
@ -279,7 +280,7 @@ class ExecutionContext:
|
||||||
if self._is_request_context and self.request is not None:
|
if self._is_request_context and self.request is not None:
|
||||||
# Run request teardown functions
|
# Run request teardown functions
|
||||||
for func in reversed(self._after_request_functions):
|
for func in reversed(self._after_request_functions):
|
||||||
if hasattr(self.request, 'response'):
|
if hasattr(self.request, "response"):
|
||||||
self.app.ensure_sync(func)(self.request.response)
|
self.app.ensure_sync(func)(self.request.response)
|
||||||
request_tearing_down.send(self.app, exc=exc)
|
request_tearing_down.send(self.app, exc=exc)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue