[Small] Capture AttributeError when checking ray dependency. (#29024)

Signed-off-by: Chenheli Hua <huachenheli@outlook.com>
This commit is contained in:
Chenheli Hua 2025-11-20 22:54:10 -08:00 committed by GitHub
parent b4734b9550
commit e4c3182c68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -10,6 +10,8 @@ def is_ray_initialized():
return ray.is_initialized()
except ImportError:
return False
except AttributeError:
return False
def is_in_ray_actor():
@ -24,3 +26,5 @@ def is_in_ray_actor():
)
except ImportError:
return False
except AttributeError:
return False