Skip to content

Fix for Explicit returns mixed with implicit (fall through) returns#163

Merged
redreceipt merged 1 commit intomainfrom
finding-autofix-9890ebed
Dec 24, 2025
Merged

Fix for Explicit returns mixed with implicit (fall through) returns#163
redreceipt merged 1 commit intomainfrom
finding-autofix-9890ebed

Conversation

@redreceipt
Copy link
Member

  • In general, to fix this class of issue you ensure all control-flow paths in a function either explicitly return a value (of a consistent type) or explicitly raise, so that no path falls through to an implicit None return.
  • For with_retries.wrapper, the best minimal change is to add an explicit return func(*args, **kwargs) after the loop, which will only be reached if, for some reason, the loop completes without returning or raising. To preserve current semantics exactly, we should structure it so normal cases are unaffected and any theoretically fall-through path still returns a value of the same type as successful calls.
  • Concretely, in jobs.py, within with_retries, modify the wrapper function so that after the for i in range(3): ... loop finishes, there is an explicit return func(*args, **kwargs) (or alternatively an explicit return None if we wanted that behavior; here, matching the normal successful behavior is better).
  • No new imports or helper methods are needed; this is a local control-flow fix inside jobs.py.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@redreceipt redreceipt temporarily deployed to bug-board-finding-autof-eo9kzg December 24, 2025 05:16 Inactive
@redreceipt redreceipt marked this pull request as ready for review December 24, 2025 05:17
@redreceipt redreceipt merged commit 6ece858 into main Dec 24, 2025
7 checks passed
@redreceipt redreceipt deleted the finding-autofix-9890ebed branch December 24, 2025 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant