Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot use intercept_channel with with statement #28

Open
wtnb75 opened this issue Feb 26, 2020 · 0 comments
Open

cannot use intercept_channel with with statement #28

wtnb75 opened this issue Feb 26, 2020 · 0 comments

Comments

@wtnb75
Copy link

wtnb75 commented Feb 26, 2020

grpc channel is usually used with with statement like here -> https://github.com/grpc/grpc/blob/master/examples/python/helloworld/greeter_client_with_options.py#L31

but...

import opentracing
from grpc_opentracing import open_tracing_client_interceptor
from grpc_opentracing.grpcext import intercept_channel
from grpc import insecure_channel

ic = open_tracing_client_interceptor(opentracing.global_tracer())
with intercept_channel(insecure_channel("localhost:5000"), ic) as ch:
  pass  # blabla
Traceback (most recent call last):
  File "testwith.py", line 7, in <module>
    with intercept_channel(insecure_channel("localhost:5000"), ic) as ch:
AttributeError: __enter__
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant