Skip to content

Commit b55c1ce

Browse files
committed
removed unused code
1 parent 087bbeb commit b55c1ce

File tree

1 file changed

+3
-12
lines changed
  • sentry_sdk/integrations/openai_agents/patches

1 file changed

+3
-12
lines changed

sentry_sdk/integrations/openai_agents/patches/runner.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import asyncio
2-
31
from functools import wraps
42

53
import sentry_sdk
@@ -16,12 +14,11 @@
1614
def _create_run_wrapper(original_func):
1715
# type: (Callable[..., Any]) -> Callable[..., Any]
1816
"""
19-
Wraps the agents.Runner.run* methods to create a root span for the agent workflow runs.
17+
Wraps the agents.Runner.run methods to create a root span for the agent workflow runs.
2018
"""
21-
is_async = asyncio.iscoroutinefunction(original_func)
2219

2320
@wraps(original_func)
24-
async def async_wrapper(*args, **kwargs):
21+
async def wrapper(*args, **kwargs):
2522
# type: (*Any, **Any) -> Any
2623
agent = args[0]
2724
with agent_workflow_span(agent):
@@ -39,10 +36,4 @@ async def async_wrapper(*args, **kwargs):
3936

4037
raise exc from None
4138

42-
@wraps(original_func)
43-
def sync_wrapper(*args, **kwargs):
44-
# type: (*Any, **Any) -> Any
45-
# The sync version (.run_sync()) is just a wrapper around the async version (.run())
46-
return original_func(*args, **kwargs)
47-
48-
return async_wrapper if is_async else sync_wrapper
39+
return wrapper

0 commit comments

Comments
 (0)