Skip to content

Commit e23a8f1

Browse files
sentrivanaclaude
andauthored
ref(celery): Remove unused NoOpMgr from utils (#6078)
In the Celery integration, we use a custom `NoOpMgr` to make working with context managers a bit easier. It's defined in the file where we use it. There is another, completely unused copy in the `utils.py` of the Celery integration. Remove that one. Note: Once we drop 3.6 support, we can replace the custom class with `nullcontext` from the standard library. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent fe7e848 commit e23a8f1

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

sentry_sdk/integrations/celery/utils.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from typing import TYPE_CHECKING, cast
33

44
if TYPE_CHECKING:
5-
from typing import Any, Tuple
5+
from typing import Tuple
66
from sentry_sdk._types import MonitorConfigScheduleUnit
77

88

@@ -29,11 +29,3 @@ def _get_humanized_interval(seconds: float) -> "Tuple[int, MonitorConfigSchedule
2929
return (interval, cast("MonitorConfigScheduleUnit", unit))
3030

3131
return (int(seconds), "second")
32-
33-
34-
class NoOpMgr:
35-
def __enter__(self) -> None:
36-
return None
37-
38-
def __exit__(self, exc_type: "Any", exc_value: "Any", traceback: "Any") -> None:
39-
return None

0 commit comments

Comments
 (0)