MCPcopy Index your code
hub / github.com/RustPython/RustPython / _retry_thrice

Function _retry_thrice

Lib/test/test_urllib2net.py:21–28  ·  view source on GitHub ↗
(func, exc, *args, **kwargs)

Source from the content-addressed store, hash-verified

19
20
21def _retry_thrice(func, exc, *args, **kwargs):
22 for i in range(3):
23 try:
24 return func(*args, **kwargs)
25 except exc as e:
26 last_exc = e
27 continue
28 raise last_exc
29
30def _wrap_with_retry_thrice(func, exc):
31 def wrapped(*args, **kwargs):

Callers 1

wrappedFunction · 0.85

Calls 1

funcFunction · 0.70

Tested by

no test coverage detected