File tree Expand file tree Collapse file tree 1 file changed +0
-36
lines changed Expand file tree Collapse file tree 1 file changed +0
-36
lines changed Original file line number Diff line number Diff line change 6
6
import time
7
7
import types
8
8
import typing as t
9
- import warnings
10
9
from typing import Callable , Optional
11
10
12
11
from libtmux .server import Server
@@ -42,41 +41,6 @@ def __next__(self) -> str:
42
41
fixtures_dir = os .path .realpath (os .path .join (current_dir , "fixtures" ))
43
42
44
43
45
- def retry (seconds : float = RETRY_TIMEOUT_SECONDS ) -> bool :
46
- """
47
- Retry a block of code until a time limit or ``break``.
48
-
49
- .. deprecated:: 0.12.0
50
- `retry` doesn't work, it will be removed in libtmux 0.13.0, it is replaced by
51
- `retry_until`, more info: https://github.com/tmux-python/libtmux/issues/368.
52
-
53
- Parameters
54
- ----------
55
- seconds : float
56
- Seconds to retry, defaults to ``RETRY_TIMEOUT_SECONDS``, which is
57
- configurable via environmental variables.
58
-
59
- Returns
60
- -------
61
- bool
62
- True if time passed since retry() invoked less than seconds param.
63
-
64
- Examples
65
- --------
66
-
67
- >>> while retry():
68
- ... p = w.attached_pane
69
- ... p.server._update_panes()
70
- ... if p.current_path == pane_path:
71
- ... break
72
- """
73
- warnings .warn (
74
- "retry() is being deprecated and will soon be replaced by retry_until()" ,
75
- DeprecationWarning ,
76
- )
77
- return (lambda : time .time () < time .time () + seconds )()
78
-
79
-
80
44
def retry_until (
81
45
fun : Callable [[], bool ],
82
46
seconds : float = RETRY_TIMEOUT_SECONDS ,
You can’t perform that action at this time.
0 commit comments