Skip to content

Commit 5bff39b

Browse files
committed
Fix type hint
1 parent ea17a3e commit 5bff39b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

opentelemetry-api/src/opentelemetry/context/__init__.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
logger = logging.getLogger(__name__)
2626

2727

28-
def _load_runtime_context() -> typing.Optional[_RuntimeContext]:
28+
def _load_runtime_context() -> _RuntimeContext:
2929
"""Initialize the RuntimeContext
3030
3131
Returns:
@@ -127,7 +127,7 @@ def get_current() -> Context:
127127
Returns:
128128
The current `Context` object.
129129
"""
130-
return _RUNTIME_CONTEXT.get_current() # type:ignore
130+
return _RUNTIME_CONTEXT.get_current()
131131

132132

133133
def attach(context: Context) -> object:
@@ -140,7 +140,7 @@ def attach(context: Context) -> object:
140140
Returns:
141141
A token that can be used with `detach` to reset the context.
142142
"""
143-
return _RUNTIME_CONTEXT.attach(context) # type:ignore
143+
return _RUNTIME_CONTEXT.attach(context)
144144

145145

146146
def detach(token: object) -> None:
@@ -151,7 +151,7 @@ def detach(token: object) -> None:
151151
token: The Token that was returned by a previous call to attach a Context.
152152
"""
153153
try:
154-
_RUNTIME_CONTEXT.detach(token) # type: ignore
154+
_RUNTIME_CONTEXT.detach(token)
155155
except Exception: # pylint: disable=broad-except
156156
logger.exception("Failed to detach context")
157157

0 commit comments

Comments
 (0)