From 33e5c0d0912900ed9c1fab8c144f5fca67120378 Mon Sep 17 00:00:00 2001 From: Paul Petit Date: Thu, 16 Aug 2018 11:35:30 +0200 Subject: [PATCH] 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. --- src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi index d2c0389ca6a..0a25218e19e 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi +++ b/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)