Merge pull request #23201 from lidizheng/fix-del-2

Prevent another exception spam in _ChannelCallState.__del__
reviewable/pr22951/r5
Lidi Zheng 5 years ago committed by GitHub
commit 5cfe11049b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/python/grpcio/grpc/_channel.py

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

Loading…
Cancel
Save