Write a more meaningful comment instead of linking to the PR

pull/36837/head
Maxence Boutet 8 months ago committed by GitHub
parent 200f9f3577
commit 831152ca47
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      src/python/grpcio/grpc/aio/_channel.py

@ -419,7 +419,10 @@ class Channel(_base_channel.Channel):
# Locate ones created by `aio.Call`.
frame = stack[0]
candidate = frame.f_locals.get("self")
if candidate is not None: # https://github.com/grpc/grpc/pull/36837
# Explicitly check for a non-null candidate instead of the more pythonic 'if candidate:'
# because doing 'if candidate:' assumes that the coroutine implements '__bool__' which
# might not always be the case.
if candidate is not None:
if isinstance(candidate, _base_call.Call):
if hasattr(candidate, "_channel"):
# For intercepted Call object

Loading…
Cancel
Save