From 3e3bbdff917e5c56f6c29bc35c8eb989192325e7 Mon Sep 17 00:00:00 2001 From: Nathaniel Manista Date: Thu, 28 Sep 2017 22:36:31 +0000 Subject: Raise exception instances rather than classes --- src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/python/grpcio') diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi index d860173b5d..782a684d25 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi @@ -454,7 +454,7 @@ cdef class _MetadataIterator: self.i = self.i + 1 return result else: - raise StopIteration + raise StopIteration() # TODO(https://github.com/grpc/grpc/issues/7950): Eliminate this; just use an @@ -518,7 +518,7 @@ cdef class MetadataArray: def __getitem__(self, size_t i): if i >= self.c_metadata_array.count: - raise IndexError + raise IndexError() key = _slice_bytes(self.c_metadata_array.metadata[i].key) value = _slice_bytes(self.c_metadata_array.metadata[i].value) return Metadatum(key=key, value=value) @@ -720,7 +720,7 @@ cdef class _OperationsIterator: self.i = self.i + 1 return result else: - raise StopIteration + raise StopIteration() cdef class Operations: -- cgit v1.2.3