grpc_1_0 flag for gRPC Python Protoc Plug-In

We'll soon be flipping the default behavior of gRPC Python Protoc
Plug-In to the later-than-gRPC-1.0 "code elements only in a
separate _pb2_grpc.py file and no Beta-API-using generated code
elements" behavior; this flag will be the supported (supported for a
while, though not exactly sure how long) means of using the older
"also put gRPC-using code elements in the generated _pb2.py file"
behavior that has been in place since gRPC 1.0.
pull/12551/head
Nathaniel Manista 8 years ago
parent 4138889086
commit d01fd422ec
  1. 2
      src/compiler/python_generator.cc

@ -769,7 +769,7 @@ bool PythonGrpcGenerator::Generate(const FileDescriptor* file,
PrivateGenerator generator(config_, &pbfile);
if (parameter == "grpc_2_0") {
return GenerateGrpc(context, generator, pb2_grpc_file_name, true);
} else if (parameter == "") {
} else if (parameter == "grpc_1_0" || parameter == "") {
return GenerateGrpc(context, generator, pb2_grpc_file_name, true) &&
GenerateGrpc(context, generator, pb2_file_name, false);
} else {

Loading…
Cancel
Save