Merge pull request #23176 from lidizheng/fix-del

Avoid attribute error in __del__ of _ChannelCallState
pull/23187/head
Lidi Zheng 5 years ago committed by GitHub
commit 8cd6ee6297
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/python/grpcio/grpc/_channel.py

@ -1123,7 +1123,9 @@ class _ChannelCallState(object):
self.managed_calls = 0
def __del__(self):
self.channel.close(cygrpc.StatusCode.cancelled, 'Channel deallocated!')
if hasattr(self, 'channel') and self.channel:
self.channel.close(cygrpc.StatusCode.cancelled,
'Channel deallocated!')
def _run_channel_spin_thread(state):

Loading…
Cancel
Save