Merge pull request #19708 from igorzhilianin/master

Check call.trailing_metadata() for None before iterating it
pull/19629/head
Lidi Zheng 6 years ago committed by GitHub
commit b0c9849393
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/python/grpcio_status/grpc_status/rpc_status.py

@ -52,6 +52,8 @@ def from_call(call):
ValueError: If the gRPC call's code or details are inconsistent with the
status code and message inside of the google.rpc.status.Status.
"""
if call.trailing_metadata() is None:
return None
for key, value in call.trailing_metadata():
if key == _GRPC_DETAILS_METADATA_KEY:
rich_status = status_pb2.Status.FromString(value)

Loading…
Cancel
Save