tenacity 8.4.1__py3-none-any.whl → 8.4.2__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.
- tenacity/__init__.py +8 -2
- tenacity/asyncio/__init__.py +9 -4
- {tenacity-8.4.1.dist-info → tenacity-8.4.2.dist-info}/METADATA +1 -1
- {tenacity-8.4.1.dist-info → tenacity-8.4.2.dist-info}/RECORD +7 -7
- {tenacity-8.4.1.dist-info → tenacity-8.4.2.dist-info}/LICENSE +0 -0
- {tenacity-8.4.1.dist-info → tenacity-8.4.2.dist-info}/WHEEL +0 -0
- {tenacity-8.4.1.dist-info → tenacity-8.4.2.dist-info}/top_level.txt +0 -0
tenacity/__init__.py
CHANGED
|
@@ -329,13 +329,19 @@ class BaseRetrying(ABC):
|
|
|
329
329
|
f, functools.WRAPPER_ASSIGNMENTS + ("__defaults__", "__kwdefaults__")
|
|
330
330
|
)
|
|
331
331
|
def wrapped_f(*args: t.Any, **kw: t.Any) -> t.Any:
|
|
332
|
-
|
|
332
|
+
# Always create a copy to prevent overwriting the local contexts when
|
|
333
|
+
# calling the same wrapped functions multiple times in the same stack
|
|
334
|
+
copy = self.copy()
|
|
335
|
+
wrapped_f.statistics = copy.statistics # type: ignore[attr-defined]
|
|
336
|
+
return copy(f, *args, **kw)
|
|
333
337
|
|
|
334
338
|
def retry_with(*args: t.Any, **kwargs: t.Any) -> WrappedFn:
|
|
335
339
|
return self.copy(*args, **kwargs).wraps(f)
|
|
336
340
|
|
|
337
|
-
|
|
341
|
+
# Preserve attributes
|
|
342
|
+
wrapped_f.retry = wrapped_f # type: ignore[attr-defined]
|
|
338
343
|
wrapped_f.retry_with = retry_with # type: ignore[attr-defined]
|
|
344
|
+
wrapped_f.statistics = {} # type: ignore[attr-defined]
|
|
339
345
|
|
|
340
346
|
return wrapped_f # type: ignore[return-value]
|
|
341
347
|
|
tenacity/asyncio/__init__.py
CHANGED
|
@@ -175,18 +175,23 @@ class AsyncRetrying(BaseRetrying):
|
|
|
175
175
|
raise StopAsyncIteration
|
|
176
176
|
|
|
177
177
|
def wraps(self, fn: WrappedFn) -> WrappedFn:
|
|
178
|
-
|
|
178
|
+
wrapped = super().wraps(fn)
|
|
179
179
|
# Ensure wrapper is recognized as a coroutine function.
|
|
180
180
|
|
|
181
181
|
@functools.wraps(
|
|
182
182
|
fn, functools.WRAPPER_ASSIGNMENTS + ("__defaults__", "__kwdefaults__")
|
|
183
183
|
)
|
|
184
184
|
async def async_wrapped(*args: t.Any, **kwargs: t.Any) -> t.Any:
|
|
185
|
-
|
|
185
|
+
# Always create a copy to prevent overwriting the local contexts when
|
|
186
|
+
# calling the same wrapped functions multiple times in the same stack
|
|
187
|
+
copy = self.copy()
|
|
188
|
+
async_wrapped.statistics = copy.statistics # type: ignore[attr-defined]
|
|
189
|
+
return await copy(fn, *args, **kwargs)
|
|
186
190
|
|
|
187
191
|
# Preserve attributes
|
|
188
|
-
async_wrapped.retry =
|
|
189
|
-
async_wrapped.retry_with =
|
|
192
|
+
async_wrapped.retry = async_wrapped # type: ignore[attr-defined]
|
|
193
|
+
async_wrapped.retry_with = wrapped.retry_with # type: ignore[attr-defined]
|
|
194
|
+
async_wrapped.statistics = {} # type: ignore[attr-defined]
|
|
190
195
|
|
|
191
196
|
return async_wrapped # type: ignore[return-value]
|
|
192
197
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
tenacity/__init__.py,sha256=
|
|
1
|
+
tenacity/__init__.py,sha256=_KlyQOzUwzhJeW9qH-_hoyFzV-AZ_aRg2f5qei8o_0I,24026
|
|
2
2
|
tenacity/_utils.py,sha256=5AwPoFrGOIfPkCtqeJdFBi7KKQNcJXJ3erbtGOXtn6w,2916
|
|
3
3
|
tenacity/after.py,sha256=NR4rGyslG7xF1hDJZb2Wf8wVApafX0HZwz2nFVLvaqE,1658
|
|
4
4
|
tenacity/before.py,sha256=7zDTpZ3b6rkY9sOdS-qbpjBgSjVr3xBqcIqdYAh9ZKM,1544
|
|
@@ -9,10 +9,10 @@ tenacity/retry.py,sha256=PVnZfXBeLN2DzsytKexw23SPLn82AdZfFPC2OhVQ_1Y,8986
|
|
|
9
9
|
tenacity/stop.py,sha256=wQuwGfCLw8OH1C3x0G9lH9xtJCyhgviePQ40HRAUg54,4113
|
|
10
10
|
tenacity/tornadoweb.py,sha256=vS1ONfPYoGzPx1asQaVbfoo6D9tPIzSysJipm61Yqw8,2125
|
|
11
11
|
tenacity/wait.py,sha256=Q9XoZCtFra53aQOyfABpvRDuUeB-NpUUXImHsUiRQI0,8042
|
|
12
|
-
tenacity/asyncio/__init__.py,sha256=
|
|
12
|
+
tenacity/asyncio/__init__.py,sha256=SWnrZkyPTvQHvhTAcPVTLCT3LVxg5ICzhUcyt5tMxsE,7782
|
|
13
13
|
tenacity/asyncio/retry.py,sha256=ymu8F1JfAerc5vDO0V4-2kCvHXqyce2jpO1Nlt6aKxI,4244
|
|
14
|
-
tenacity-8.4.
|
|
15
|
-
tenacity-8.4.
|
|
16
|
-
tenacity-8.4.
|
|
17
|
-
tenacity-8.4.
|
|
18
|
-
tenacity-8.4.
|
|
14
|
+
tenacity-8.4.2.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
|
|
15
|
+
tenacity-8.4.2.dist-info/METADATA,sha256=lEJwjb1dtrlcvg7A-aGxccyqNws7q-sROWoF_1U_O44,1155
|
|
16
|
+
tenacity-8.4.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
17
|
+
tenacity-8.4.2.dist-info/top_level.txt,sha256=Zf8AOZMN7hr1EEcUo9U5KzXsM4TOC1pBZ22D8913JYs,9
|
|
18
|
+
tenacity-8.4.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|