Skip to content

Commit a227c4e

Browse files
fix(ray): Guard against module shadowing
1 parent 86d326c commit a227c4e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sentry_sdk/integrations/ray.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
try:
1818
import ray # type: ignore[import-not-found]
19+
from ray import remote
1920
except ImportError:
2021
raise DidNotEnable("Ray not installed.")
2122

@@ -37,7 +38,7 @@ def _check_sentry_initialized() -> None:
3738

3839

3940
def _patch_ray_remote() -> None:
40-
old_remote = ray.remote
41+
old_remote = remote
4142

4243
@functools.wraps(old_remote)
4344
def new_remote(

tests/test_shadowed_module.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ def pytest_generate_tests(metafunc):
3434
"litellm",
3535
"opentelemetry",
3636
"pure_eval",
37-
"ray",
3837
"trytond",
3938
"typer",
4039
},

0 commit comments

Comments
 (0)