Implement missing context methods (#363)

This commit is contained in:
Diego Hurtado
2021-04-07 10:15:40 -06:00
committed by GitHub
parent ca8eac61c2
commit 3e1a9fa0c2
2 changed files with 5 additions and 2 deletions

View File

@ -22,6 +22,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [0.19b0](https://github.com/open-telemetry/opentelemetry-python-contrib/releases/tag/v0.19b0) - 2021-03-26
- Implement context methods for `_InterceptorChannel`
([#363](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/363))
### Changed
- Rename `IdsGenerator` to `IdGenerator`
([#350](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/350))

View File

@ -232,11 +232,11 @@ class _InterceptorChannel(grpc.Channel):
def __enter__(self):
"""Enters the runtime context related to the channel object."""
raise NotImplementedError()
return self
def __exit__(self, exc_type, exc_val, exc_tb):
"""Exits the runtime context related to the channel object."""
raise NotImplementedError()
self.close()
def intercept_channel(channel, *interceptors):