Skip to content

Commit 03dc022

Browse files
Fix for Empty except (#817)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent c430e27 commit 03dc022

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

python_package/brainflow/ml_model.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ def __init__(self):
9494
dir_path = os.path.abspath(os.path.dirname(full_path))
9595
try:
9696
os.add_dll_directory(dir_path)
97-
except:
97+
except (AttributeError, OSError):
98+
# Ignore when API is unavailable or directory registration fails;
99+
# PATH/LD_LIBRARY_PATH fallback is applied below.
98100
pass
99101
if platform.system() == 'Windows':
100102
os.environ['PATH'] = dir_path + os.pathsep + os.environ.get('PATH', '')

0 commit comments

Comments
 (0)