Sweep: Refactor edit_sweep_comment function in on_ticket.py to remove nonlocal usage
#4026
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
This pull request refactors the
edit_sweep_commentfunction in theon_ticket.pyfile to remove the use ofnonlocalvariables. Instead, all necessary variables are passed as arguments to the function.Description
The main changes in this pull request are:
edit_sweep_commentfunction now takes additional arguments:current_index,user_token,g,repo,issue_comment,initial_sandbox_response, andinitial_sandbox_response_file.nonlocalusage has been removed from theedit_sweep_commentfunction, and all necessary variables are now passed as arguments.edit_sweep_commenthave been updated to include the new arguments.Summary
edit_sweep_commentfunction insweepai/handlers/on_ticket.pyto removenonlocalusageedit_sweep_commentfunction to pass all necessary variablesedit_sweep_commentto include the new argumentsFixes #3672.
Tip
To get Sweep to edit this pull request, you can:
This is an automated message generated by Sweep AI.