Skip to content

Fix duplicate function definition in _remove_readonly#91

Merged
olearycrew merged 3 commits intopinchbench:mainfrom
ScuttleBot:fix/duplicate-function-def
Apr 1, 2026
Merged

Fix duplicate function definition in _remove_readonly#91
olearycrew merged 3 commits intopinchbench:mainfrom
ScuttleBot:fix/duplicate-function-def

Conversation

@ScuttleBot
Copy link
Copy Markdown

PR #74 introduced a duplicate function definition that causes an IndentationError, breaking all benchmark registrations:

File "/root/skill/scripts/lib_agent.py", line 370
    def _remove_readonly(func, path, _):
    ^
IndentationError: expected an indented block after function definition on line 369

This removes the duplicate line and the errant func(path) call that was outside the try/except block.

Before:

def _remove_readonly(func, path, _):
def _remove_readonly(func, path, _):
    try:
        os.chmod(path, stat.S_IWRITE)
        func(path)
    except OSError:
        pass
    func(path)

After:

def _remove_readonly(func, path, _):
    try:
        os.chmod(path, stat.S_IWRITE)
        func(path)
    except OSError:
        pass

PR pinchbench#74 introduced a duplicate function definition that causes an IndentationError,
breaking all benchmark registrations. This removes the duplicate line and the
errant func(path) call that was outside the try/except block.
The import after sys.path manipulation triggers E402. Adding noqa comment
since this pattern is necessary for the test to import from scripts/.
@olearycrew olearycrew merged commit 07e2514 into pinchbench:main Apr 1, 2026
1 check passed
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.

2 participants