asgiref 3.9.0__py3-none-any.whl → 3.9.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- asgiref/__init__.py +1 -1
- asgiref/local.py +14 -15
- {asgiref-3.9.0.dist-info → asgiref-3.9.1.dist-info}/METADATA +1 -1
- {asgiref-3.9.0.dist-info → asgiref-3.9.1.dist-info}/RECORD +7 -7
- {asgiref-3.9.0.dist-info → asgiref-3.9.1.dist-info}/WHEEL +0 -0
- {asgiref-3.9.0.dist-info → asgiref-3.9.1.dist-info}/licenses/LICENSE +0 -0
- {asgiref-3.9.0.dist-info → asgiref-3.9.1.dist-info}/top_level.txt +0 -0
asgiref/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "3.9.
|
|
1
|
+
__version__ = "3.9.1"
|
asgiref/local.py
CHANGED
|
@@ -2,38 +2,37 @@ import asyncio
|
|
|
2
2
|
import contextlib
|
|
3
3
|
import contextvars
|
|
4
4
|
import threading
|
|
5
|
-
from typing import Any, Union
|
|
5
|
+
from typing import Any, Dict, Union
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class _CVar:
|
|
9
9
|
"""Storage utility for Local."""
|
|
10
10
|
|
|
11
11
|
def __init__(self) -> None:
|
|
12
|
-
self._data:
|
|
12
|
+
self._data: "contextvars.ContextVar[Dict[str, Any]]" = contextvars.ContextVar(
|
|
13
|
+
"asgiref.local"
|
|
14
|
+
)
|
|
13
15
|
|
|
14
|
-
def __getattr__(self, key
|
|
16
|
+
def __getattr__(self, key):
|
|
17
|
+
storage_object = self._data.get({})
|
|
15
18
|
try:
|
|
16
|
-
|
|
19
|
+
return storage_object[key]
|
|
17
20
|
except KeyError:
|
|
18
21
|
raise AttributeError(f"{self!r} object has no attribute {key!r}")
|
|
19
22
|
|
|
20
|
-
try:
|
|
21
|
-
return var.get()
|
|
22
|
-
except LookupError:
|
|
23
|
-
raise AttributeError(f"{self!r} object has no attribute {key!r}")
|
|
24
|
-
|
|
25
23
|
def __setattr__(self, key: str, value: Any) -> None:
|
|
26
24
|
if key == "_data":
|
|
27
25
|
return super().__setattr__(key, value)
|
|
28
26
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
var.set(value)
|
|
27
|
+
storage_object = self._data.get({}).copy()
|
|
28
|
+
storage_object[key] = value
|
|
29
|
+
self._data.set(storage_object)
|
|
33
30
|
|
|
34
31
|
def __delattr__(self, key: str) -> None:
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
storage_object = self._data.get({}).copy()
|
|
33
|
+
if key in storage_object:
|
|
34
|
+
del storage_object[key]
|
|
35
|
+
self._data.set(storage_object)
|
|
37
36
|
else:
|
|
38
37
|
raise AttributeError(f"{self!r} object has no attribute {key!r}")
|
|
39
38
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
asgiref/__init__.py,sha256=
|
|
1
|
+
asgiref/__init__.py,sha256=97OdSef30we1CjsM0qA6wEMk67472iE4_gOoam4odOg,22
|
|
2
2
|
asgiref/compatibility.py,sha256=DhY1SOpOvOw0Y1lSEjCqg-znRUQKecG3LTaV48MZi68,1606
|
|
3
3
|
asgiref/current_thread_executor.py,sha256=42CU1VODLTk-_PYise-cP1XgyAvI5Djc8f97owFzdrs,4157
|
|
4
|
-
asgiref/local.py,sha256=
|
|
4
|
+
asgiref/local.py,sha256=ZZeWWIXptVU4GbNApMMWQ-skuglvodcQA5WpzJDMxh4,4912
|
|
5
5
|
asgiref/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
asgiref/server.py,sha256=3A68169Nuh2sTY_2O5JzRd_opKObWvvrEFcrXssq3kA,6311
|
|
7
7
|
asgiref/sync.py,sha256=5dlK0T61pMSNWf--49nUojn0mfduqq6ryuwyXxv2Y-A,20417
|
|
@@ -9,8 +9,8 @@ asgiref/testing.py,sha256=U5wcs_-ZYTO5SIGfl80EqRAGv_T8BHrAhvAKRuuztT4,4421
|
|
|
9
9
|
asgiref/timeout.py,sha256=LtGL-xQpG8JHprdsEUCMErJ0kNWj4qwWZhEHJ3iKu4s,3627
|
|
10
10
|
asgiref/typing.py,sha256=Zi72AZlOyF1C7N14LLZnpAdfUH4ljoBqFdQo_bBKMq0,6290
|
|
11
11
|
asgiref/wsgi.py,sha256=fxBLgUE_0PEVgcp13ticz6GHf3q-aKWcB5eFPhd6yxo,6753
|
|
12
|
-
asgiref-3.9.
|
|
13
|
-
asgiref-3.9.
|
|
14
|
-
asgiref-3.9.
|
|
15
|
-
asgiref-3.9.
|
|
16
|
-
asgiref-3.9.
|
|
12
|
+
asgiref-3.9.1.dist-info/licenses/LICENSE,sha256=uEZBXRtRTpwd_xSiLeuQbXlLxUbKYSn5UKGM0JHipmk,1552
|
|
13
|
+
asgiref-3.9.1.dist-info/METADATA,sha256=FI1qnkAdT303WxkQlnpXEZ49dO1z-srL9L-_7uYjqTk,9286
|
|
14
|
+
asgiref-3.9.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
15
|
+
asgiref-3.9.1.dist-info/top_level.txt,sha256=bokQjCzwwERhdBiPdvYEZa4cHxT4NCeAffQNUqJ8ssg,8
|
|
16
|
+
asgiref-3.9.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|