Skip to content

Commit e4e440a

Browse files
committed
chore: Add DeprecationWarning for retry()
1 parent dce1003 commit e4e440a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

libtmux/test.py

+9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import os
55
import tempfile
66
import time
7+
import warnings
78
from typing import Optional
89

910
from .exc import WaitTimeout
@@ -24,6 +25,10 @@ def retry(seconds: Optional[float] = RETRY_TIMEOUT_SECONDS) -> bool:
2425
"""
2526
Retry a block of code until a time limit or ``break``.
2627
28+
.. deprecated:: 0.12.0
29+
`retry` doesn't work, it will be removed in libtmux 0.13.0, it is replaced by
30+
`retry_until`, more info: https://github.com/tmux-python/libtmux/issues/368.
31+
2732
Parameters
2833
----------
2934
seconds : float
@@ -44,6 +49,10 @@ def retry(seconds: Optional[float] = RETRY_TIMEOUT_SECONDS) -> bool:
4449
... if p.current_path == pane_path:
4550
... break
4651
"""
52+
warnings.warn(
53+
"retry() is being deprecated and will soon be replaced by retry_until()",
54+
DeprecationWarning,
55+
)
4756
return (lambda: time.time() < time.time() + seconds)()
4857

4958

0 commit comments

Comments
 (0)