Skip to content

Fix for Empty except#38

Merged
RobertBlackhart merged 1 commit into
mainfrom
finding-autofix-71738d7b
Apr 14, 2026
Merged

Fix for Empty except#38
RobertBlackhart merged 1 commit into
mainfrom
finding-autofix-71738d7b

Conversation

@RobertBlackhart
Copy link
Copy Markdown
Collaborator

The best fix is to replace the try/except TypeError: pass logic with an explicit callable(...) check before invoking available_choices. This preserves behavior (support both static list and callable) while removing the empty except and preventing accidental suppression of real TypeErrors thrown by a callable implementation.

In recline/arg_types/choices.py, inside _Choices.choices (around lines 79–83), update the code so that:

  • current_choices is initialized from self.__class__.available_choices as it is now.
  • Only call it when it is callable.
  • Remove the empty except TypeError block entirely.

No new imports, methods, or dependencies are needed.

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>
@RobertBlackhart RobertBlackhart marked this pull request as ready for review April 14, 2026 22:28
@RobertBlackhart RobertBlackhart merged commit 0413b95 into main Apr 14, 2026
9 checks passed
@RobertBlackhart RobertBlackhart deleted the finding-autofix-71738d7b branch April 14, 2026 22:28
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