From 1cdcfbe397f751c4bba1eb8d977ce77d874b4527 Mon Sep 17 00:00:00 2001 From: Andrey Parfenov Date: Sun, 26 Apr 2026 18:46:44 +0700 Subject: [PATCH] Fix for Empty except Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- python_package/brainflow/board_shim.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python_package/brainflow/board_shim.py b/python_package/brainflow/board_shim.py index 56133cf07..6c365247a 100644 --- a/python_package/brainflow/board_shim.py +++ b/python_package/brainflow/board_shim.py @@ -191,7 +191,10 @@ def __init__(self): # for python 3.8 PATH env var doesnt work anymore try: os.add_dll_directory(dir_path) - except: + except (AttributeError, FileNotFoundError, OSError): + # Best effort only: this may be unavailable or fail on some + # platforms/runtime configurations; PATH/LD_LIBRARY_PATH is + # updated below as a fallback. pass if platform.system() == 'Windows': os.environ['PATH'] = dir_path + os.pathsep + os.environ.get('PATH', '')