Skip to content

Fix for Empty except#821

Merged
Andrey1994 merged 1 commit intomasterfrom
finding-autofix-928e71fb
Apr 26, 2026
Merged

Fix for Empty except#821
Andrey1994 merged 1 commit intomasterfrom
finding-autofix-928e71fb

Conversation

@Andrey1994
Copy link
Copy Markdown
Member

To fix this without changing behavior, keep the timeout handlers but add explicit explanatory comments in those except blocks to document that timeout is expected during polling and the loop should continue.

Best single fix:

  • In emulator/brainflow_emulator/biolistener_emulator.py, update the two empty except clauses in the receive loop:
    • except TimeoutError:
    • except socket.timeout:
  • Replace pass with pass plus a short comment (or just a comment plus pass) explaining that timeout is normal when no command is received and should not be logged as an error.

No new imports, methods, or dependencies are required.

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:23
@Andrey1994 Andrey1994 merged commit 36e04ef into master Apr 26, 2026
37 of 38 checks 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.

1 participant