Skip to content

Commit

Permalink
Change attribute name to something more specific
Browse files Browse the repository at this point in the history
  • Loading branch information
benmezger committed May 3, 2024
1 parent d62f0b7 commit 148aa0b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyretries/retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def _save_state(self, state: RetryState[ReturnT]) -> None:
Args:
state: Current retry state
"""
setattr(state.func, "state", state)
setattr(state.func, "retry_state", state)

def _exec_strategy(self, state: RetryState[ReturnT]):
"""
Expand Down
4 changes: 2 additions & 2 deletions tests/test_retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ async def test_async_sets_state(
retry = async_retry()
await retry(async_func)

state: RetryState = async_func.state
state: RetryState = async_func.retry_state
state.returned_value = 4

assert state.start_time == 1326542401
Expand Down Expand Up @@ -331,7 +331,7 @@ def test_sync_sets_state(
retry = sync_retry()
retry(func)

state: RetryState = func.state
state: RetryState = func.retry_state
state.returned_value = 4

assert state.start_time == 1326542401
Expand Down

0 comments on commit 148aa0b

Please sign in to comment.