MCPcopy
hub / github.com/django/django / _restore_context

Function _restore_context

django/dispatch/dispatcher.py:27–38  ·  view source on GitHub ↗

Check for changes in contextvars, and set them to the current context for downstream consumers.

(context)

Source from the content-addressed store, hash-verified

25
26
27def _restore_context(context):
28 """
29 Check for changes in contextvars, and set them to the current
30 context for downstream consumers.
31 """
32 for cvar in context:
33 cvalue = context.get(cvar)
34 try:
35 if cvar.get() != cvalue:
36 cvar.set(cvalue)
37 except LookupError:
38 cvar.set(cvalue)
39
40
41async def _run_parallel(*coros):

Callers 1

_run_parallelFunction · 0.85

Calls 2

getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected