Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions retryhttp/_retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,18 @@ def retry(
if not retry_strategies:
raise RuntimeError("No retry strategies enabled.")

retry = kwargs.get("retry") or retry_any(*retry_strategies)
retry = kwargs.pop("retry", None) or retry_any(*retry_strategies)

# We don't need to conditionally build our wait strategy since each strategy
# will only apply if the corresponding retry strategy is in use.
wait = kwargs.get("wait") or wait_context_aware(
wait = kwargs.pop("wait", None) or wait_context_aware(
wait_server_errors=wait_server_errors,
wait_network_errors=wait_network_errors,
wait_timeouts=wait_timeouts,
wait_rate_limited=wait_rate_limited,
)

stop = kwargs.get("stop") or stop_after_attempt(max_attempt_number)
stop = kwargs.pop("stop", None) or stop_after_attempt(max_attempt_number)

def decorator(func: F) -> F:
return tenacity_retry(retry=retry, wait=wait, stop=stop, **kwargs)(func)
Expand Down