Replace is by == for a status comparison

This worked fine with CPython, but the condition
was always evaluated to False with Pypy, causing
bugs down the road.
Tested with Pypy 6.0.
pull/16364/head
Paul Petit 7 years ago
parent 8a86f5329e
commit 33e5c0d091
  1. 2
      src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi

@ -48,7 +48,7 @@ cdef int _get_metadata(
cdef size_t metadata_count
cdef grpc_metadata *c_metadata
def callback(metadata, grpc_status_code status, bytes error_details):
if status is StatusCode.ok:
if status == StatusCode.ok:
_store_c_metadata(metadata, &c_metadata, &metadata_count)
cb(user_data, c_metadata, metadata_count, status, NULL)
_release_c_metadata(c_metadata, metadata_count)

Loading…
Cancel
Save