Catch RuntimeErrors when importing warp.
PiperOrigin-RevId: 805586914 Change-Id: Ica3ca016c8056316d1d2f052e4d3481f578a8aad
This commit is contained in:
committed by
Copybara-Service
parent
4b18009f47
commit
da2fad4530
@@ -28,12 +28,14 @@ if not typing.TYPE_CHECKING:
|
|||||||
try:
|
try:
|
||||||
import warp
|
import warp
|
||||||
WARP_INSTALLED = True
|
WARP_INSTALLED = True
|
||||||
except ImportError:
|
except (ImportError, RuntimeError) as e:
|
||||||
|
print('Failed to import warp:', e)
|
||||||
WARP_INSTALLED = False
|
WARP_INSTALLED = False
|
||||||
try:
|
try:
|
||||||
import mujoco.mjx.third_party.mujoco_warp as mujoco_warp
|
import mujoco.mjx.third_party.mujoco_warp as mujoco_warp
|
||||||
from mujoco.mjx.third_party.mujoco_warp._src import types as mjwp_types
|
from mujoco.mjx.third_party.mujoco_warp._src import types as mjwp_types
|
||||||
except ImportError as e:
|
except (ImportError, RuntimeError) as e:
|
||||||
|
print('Failed to import mujoco.mjx.third_party.mujoco_warp as mujoco_warp:', e)
|
||||||
pass
|
pass
|
||||||
# pylint: enable=g-import-not-at-top
|
# pylint: enable=g-import-not-at-top
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user