From 1f655ad35174fc35617935874a65c5eb2a078fbf Mon Sep 17 00:00:00 2001 From: Richard Belleville Date: Wed, 17 Jun 2020 22:09:13 -0700 Subject: [PATCH] Fix gil relinquishment --- .../python/grpcio_tools/grpc_tools/_protoc_compiler.pyx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/distrib/python/grpcio_tools/grpc_tools/_protoc_compiler.pyx b/tools/distrib/python/grpcio_tools/grpc_tools/_protoc_compiler.pyx index f072d307470..9f65d55729b 100644 --- a/tools/distrib/python/grpcio_tools/grpc_tools/_protoc_compiler.pyx +++ b/tools/distrib/python/grpcio_tools/grpc_tools/_protoc_compiler.pyx @@ -37,8 +37,8 @@ cdef extern from "grpc_tools/main.h" namespace "grpc_tools": string message int protoc_main(int argc, char *argv[]) - int protoc_get_protos(char* protobuf_path, vector[string]* include_path, vector[pair[string, string]]* files_out, vector[cProtocError]* errors, vector[cProtocWarning]* wrnings) except + - int protoc_get_services(char* protobuf_path, vector[string]* include_path, vector[pair[string, string]]* files_out, vector[cProtocError]* errors, vector[cProtocWarning]* wrnings) except + + int protoc_get_protos(char* protobuf_path, vector[string]* include_path, vector[pair[string, string]]* files_out, vector[cProtocError]* errors, vector[cProtocWarning]* wrnings) nogil except + + int protoc_get_services(char* protobuf_path, vector[string]* include_path, vector[pair[string, string]]* files_out, vector[cProtocError]* errors, vector[cProtocWarning]* wrnings) nogil except + def run_main(list args not None): cdef char **argv = stdlib.malloc(len(args)*sizeof(char *)) @@ -109,8 +109,7 @@ def get_protos(bytes protobuf_path, list include_paths): cdef vector[cProtocError] errors # NOTE: Abbreviated name used to avoid shadowing of the module name. cdef vector[cProtocWarning] wrnings - with nogil: - rc = protoc_get_protos(protobuf_path, &c_include_paths, &files, &errors, &wrnings) + rc = protoc_get_protos(protobuf_path, &c_include_paths, &files, &errors, &wrnings) _handle_errors(rc, &errors, &wrnings, protobuf_path) return files