Skip to content

Fix for Empty except#820

Merged
Andrey1994 merged 1 commit into
masterfrom
finding-autofix-67f55eb1
Apr 26, 2026
Merged

Fix for Empty except#820
Andrey1994 merged 1 commit into
masterfrom
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>
@Andrey1994 Andrey1994 marked this pull request as ready for review April 26, 2026 16:19
@Andrey1994 Andrey1994 merged commit ab1c20e into master Apr 26, 2026
38 checks passed
@Andrey1994 Andrey1994 deleted the finding-autofix-67f55eb1 branch May 9, 2026 15:27
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