[Small] Capture AttributeError when checking ray dependency. (#29024)
Signed-off-by: Chenheli Hua <huachenheli@outlook.com>
This commit is contained in:
@@ -10,6 +10,8 @@ def is_ray_initialized():
|
|||||||
return ray.is_initialized()
|
return ray.is_initialized()
|
||||||
except ImportError:
|
except ImportError:
|
||||||
return False
|
return False
|
||||||
|
except AttributeError:
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def is_in_ray_actor():
|
def is_in_ray_actor():
|
||||||
@@ -24,3 +26,5 @@ def is_in_ray_actor():
|
|||||||
)
|
)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
return False
|
return False
|
||||||
|
except AttributeError:
|
||||||
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user