Skip to content

Commit

Permalink
Appease the linter
Browse files Browse the repository at this point in the history
This code passed before, so something clearly changed.
  • Loading branch information
alertedsnake committed Feb 4, 2021
1 parent 9c3aada commit abda221
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,7 @@ def _which_channel(self, kwargs):
if "channel_type" in kwargs:
if kwargs.get("channel_type") == "secure":
return ("secure_channel",)
else:
return ("insecure_channel",)
return ("insecure_channel",)

# handle modern arguments
types = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,14 @@ def intercept_unary(self, request, metadata, client_info, invoker):

try:
result = invoker(request, metadata)
except grpc.RpcError as e:
except grpc.RpcError as err:
guarded_span.generated_span.set_status(
Status(StatusCode.ERROR)
)
guarded_span.generated_span.set_attribute(
"rpc.grpc.status_code", e.code().value[0]
"rpc.grpc.status_code", err.code().value[0]
)
raise e
raise err

return self._trace_result(
guarded_span, rpc_info, result, client_info
Expand Down Expand Up @@ -242,12 +242,12 @@ def _intercept_server_stream(
response.ByteSize(), client_info.full_method
)
yield response
except grpc.RpcError as e:
except grpc.RpcError as err:
span.set_status(Status(StatusCode.ERROR))
span.set_attribute(
"rpc.grpc.status_code", e.code().value[0]
"rpc.grpc.status_code", err.code().value[0]
)
raise e
raise err

def intercept_stream(
self, request_or_iterator, metadata, client_info, invoker
Expand Down Expand Up @@ -283,14 +283,14 @@ def intercept_stream(

try:
result = invoker(request_or_iterator, metadata)
except grpc.RpcError as e:
except grpc.RpcError as err:
guarded_span.generated_span.set_status(
Status(StatusCode.ERROR)
)
guarded_span.generated_span.set_attribute(
"rpc.grpc.status_code", e.code().value[0],
"rpc.grpc.status_code", err.code().value[0],
)
raise e
raise err

return self._trace_result(
guarded_span, rpc_info, result, client_info
Expand Down

0 comments on commit abda221

Please sign in to comment.