Skip to content

Commit 127aa76

Browse files
yashk2810hawkinsp
authored andcommitted
Return False in is_env_present if importing kubernetes leads to a ModuleNotFoundError
PiperOrigin-RevId: 748440123
1 parent fb16d53 commit 127aa76

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

jax/_src/clusters/k8s_cluster.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def is_env_present(cls) -> bool:
3434
if 'KUBERNETES_SERVICE_HOST' in os.environ:
3535
try:
3636
import kubernetes as k8s # pytype: disable=import-error
37-
except ImportError as e:
37+
except (ImportError, ModuleNotFoundError):
3838
warnings.warn(
3939
'\n'.join([
4040
textwrap.fill(

0 commit comments

Comments
 (0)