Skip to content

Commit dd52013

Browse files
xrmxQuentinN42
andauthored
Update opentelemetry-api/src/opentelemetry/util/_decorator.py
Co-authored-by: QuentinN42 <[email protected]>
1 parent 4593127 commit dd52013

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

opentelemetry-api/src/opentelemetry/util/_decorator.py

+8
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@ async def async_wrapper(*args: Pargs, **kwargs: Pkwargs) -> R:
7373

7474
def _agnosticcontextmanager(
7575
func: "Callable[P, Iterator[R]]",
76+
) -> "Callable[P, _AgnosticContextManager[R]]":
77+
@functools.wraps(func)
78+
def helper(*args: Pargs, **kwargs: Pkwargs) -> _AgnosticContextManager[R]:
79+
return _AgnosticContextManager(func, args, kwargs)
80+
81+
# Ingoring the type to keep the original signature of the function
82+
return helper # type: ignore[return-value]
83+
func: "Callable[P, Iterator[R]]",
7684
) -> "Callable[P, _AgnosticContextManager[R]]": # type: ignore[return-value]
7785
@functools.wraps(func)
7886
def helper(*args: Pargs, **kwargs: Pkwargs) -> _AgnosticContextManager[R]:

0 commit comments

Comments
 (0)