aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/python/grpcio/grpc/beta/_client_adaptations.py
diff options
context:
space:
mode:
authorGravatar Ken Payson <kpayson@google.com>2016-07-12 08:47:15 -0700
committerGravatar Ken Payson <kpayson@google.com>2016-07-18 16:23:47 -0700
commite39edac2c84f5a5195b09cca4bd9628a90318c12 (patch)
treec9b17f485fee7ea1242bdfe827819bc9ada4e776 /src/python/grpcio/grpc/beta/_client_adaptations.py
parent7c467547ba988ae56e05b02220143f4ea6930b91 (diff)
Fixed name syntax error
Diffstat (limited to 'src/python/grpcio/grpc/beta/_client_adaptations.py')
-rw-r--r--src/python/grpcio/grpc/beta/_client_adaptations.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/python/grpcio/grpc/beta/_client_adaptations.py b/src/python/grpcio/grpc/beta/_client_adaptations.py
index 73415e0be7..e4ee44d7a3 100644
--- a/src/python/grpcio/grpc/beta/_client_adaptations.py
+++ b/src/python/grpcio/grpc/beta/_client_adaptations.py
@@ -67,7 +67,7 @@ def _abortion(rpc_error_call):
error_kind = face.Abortion.Kind.LOCAL_FAILURE if pair is None else pair[0]
return face.Abortion(
error_kind, rpc_error_call.initial_metadata(),
- rpc_error_call.trailing_metadata(), code, rpc_error_code.details())
+ rpc_error_call.trailing_metadata(), code, rpc_error_call.details())
def _abortion_error(rpc_error_call):
@@ -159,9 +159,11 @@ class _Rendezvous(future.Future, face.Call):
return self._call.time_remaining()
def add_abortion_callback(self, abortion_callback):
- registered = self._call.add_callback(
- lambda: abortion_callback(_abortion(self._call)))
- return None if registered else _abortion(self._call)
+ def done_callback():
+ if self.code() is not grpc.StatusCode.OK:
+ abortion_callback(_abortion(self._call))
+ registered = self._call.add_callback(done_callback)
+ return None if registered else done_callback()
def protocol_context(self):
return _InvocationProtocolContext()