Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

- Apply the Ruff `I` rules [#99](https://github.com/python-backoff/backoff/pull/99) (from [@edgarrmondragon](https://github.com/edgarrmondragon))

- Apply the Ruff `B` rules [#100](https://github.com/python-backoff/backoff/pull/100) (from [@edgarrmondragon](https://github.com/edgarrmondragon))

## [v2.3.1] - 2025-12-18

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion backoff/_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ async def retry(*args, **kwargs):
seconds = _next_wait(wait, e, jitter, elapsed, max_time_value)
except StopIteration:
await _call_handlers(on_giveup, **details, exception=e)
raise e
raise e from None

await _call_handlers(on_backoff, **details, wait=seconds, exception=e)

Expand Down
2 changes: 1 addition & 1 deletion backoff/_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def retry(*args, **kwargs):
seconds = _next_wait(wait, e, jitter, elapsed, max_time_value)
except StopIteration:
_call_handlers(on_giveup, **details, exception=e)
raise e
raise e from None

_call_handlers(on_backoff, **details, wait=seconds, exception=e)

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ docstring-code-line-length = 20
[tool.ruff.lint]
extend-select = [
"RET", # flake8-return
"B", # flake8-bugbear
"I", # isort
"SIM", # flake8-simplify
"UP", # pyupgrade
Expand Down
2 changes: 1 addition & 1 deletion tests/test_backoff.py
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ def test_event_log_levels(

backoff_log_count = 0
giveup_log_count = 0
for logger_name, level, message in caplog.record_tuples:
for _logger_name, level, message in caplog.record_tuples:
if level == backoff_log_level and backoff_re.match(message):
backoff_log_count += 1
elif level == giveup_log_level and giveup_re.match(message):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_jitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

def test_full_jitter():
for input in range(100):
for i in range(100):
for _i in range(100):
jitter = backoff.full_jitter(input)
assert jitter >= 0
assert jitter <= input
2 changes: 1 addition & 1 deletion tests/test_wait_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def test_fibo_max_value():
def test_constant():
gen = backoff.constant(interval=3)
gen.send(None)
for i in range(9):
for _i in range(9):
assert next(gen) == 3


Expand Down
Loading