Skip to content

Fix for Empty except#816

Merged
Andrey1994 merged 1 commit intomasterfrom
finding-autofix-03fb4600
Apr 26, 2026
Merged

Fix for Empty except#816
Andrey1994 merged 1 commit intomasterfrom
finding-autofix-03fb4600

Conversation

@Andrey1994
Copy link
Copy Markdown
Member

To fix this without changing functionality, keep the best-effort behavior but replace the bare except: with explicit exception handling for expected failures from os.add_dll_directory and add a concise comment explaining why ignoring those failures is acceptable.

Best change in python_package/brainflow/board_shim.py around lines 192–195:

  • Replace:
    • except:
    • pass
  • With:
    • except (AttributeError, FileNotFoundError, OSError):
    • a comment documenting that failing to add a DLL directory is non-fatal because fallback env var handling follows
    • pass

No new imports or new 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:18
@Andrey1994 Andrey1994 merged commit 32aac0f into master Apr 26, 2026
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