Skip to content

Fix for Empty except#820

Draft
Andrey1994 wants to merge 1 commit intomasterfrom
finding-autofix-67f55eb1
Draft

Fix for Empty except#820
Andrey1994 wants to merge 1 commit intomasterfrom
finding-autofix-67f55eb1

Conversation

@Andrey1994
Copy link
Copy Markdown
Member

To fix this without changing behavior, keep the exception suppression during socket cleanup but add an explanatory comment and lightweight logging in the except block. This satisfies the rule’s requirement and preserves reconnect flow.

Best change in emulator/brainflow_emulator/biolistener_emulator.py (around lines 114–118 in run):

  • Replace the except Exception: pass with:
    • except Exception as close_err:
    • a short comment explaining close failures are expected/ignorable in reconnect cleanup
    • logging.debug(...) including the exception for diagnostics.

No new imports or dependencies are required (the file already imports logging).

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>
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