We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4593127 commit dd52013Copy full SHA for dd52013
opentelemetry-api/src/opentelemetry/util/_decorator.py
@@ -73,6 +73,14 @@ async def async_wrapper(*args: Pargs, **kwargs: Pkwargs) -> R:
73
74
def _agnosticcontextmanager(
75
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]]",
84
) -> "Callable[P, _AgnosticContextManager[R]]": # type: ignore[return-value]
85
@functools.wraps(func)
86
def helper(*args: Pargs, **kwargs: Pkwargs) -> _AgnosticContextManager[R]:
0 commit comments