Flip gRPC Python Protoc Plug-In default behavior

Now the grpc_2_0 flag is no longer required for the only-generate-code-
elements-in-_pb2_grpc.py-files behavior and the grpc_1_0 flag is
required for the add-generated-gRPC-using-code-elements-to-_pb2.py-
files behavior.
pull/12625/head
Nathaniel Manista 7 years ago
parent 086e95ae65
commit 2c1a7e1375
  1. 4
      src/compiler/python_generator.cc

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

Loading…
Cancel
Save