Fix: enable_line_profiler() doesn't return a value - handle ImportError properly

This commit is contained in:
Alexsander Hamir 2026-01-07 12:38:25 -08:00
parent 1544e8f971
commit 5f84eb7001

View file

@ -160,7 +160,9 @@ def wrap_function_with_line_profiler(module: Any, function_name: str) -> bool:
Returns:
True if wrapping was successful, False otherwise
"""
if not enable_line_profiler():
try:
enable_line_profiler() # May raise ImportError if not available
except ImportError:
return False
if _line_profiler is None: