From abe702a479d28a1f0c2b384c9e0bab4eca5a74ef Mon Sep 17 00:00:00 2001 From: Andrey Parfenov Date: Sun, 26 Apr 2026 18:46:53 +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/ml_model.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python_package/brainflow/ml_model.py b/python_package/brainflow/ml_model.py index 3dd7a8317..fe9480e33 100644 --- a/python_package/brainflow/ml_model.py +++ b/python_package/brainflow/ml_model.py @@ -94,7 +94,9 @@ def __init__(self): dir_path = os.path.abspath(os.path.dirname(full_path)) try: os.add_dll_directory(dir_path) - except: + except (AttributeError, OSError): + # Ignore when API is unavailable or directory registration fails; + # PATH/LD_LIBRARY_PATH fallback is applied below. pass if platform.system() == 'Windows': os.environ['PATH'] = dir_path + os.pathsep + os.environ.get('PATH', '')