From 2c1a7e1375ade318d5925edb7bff63f4ce522a81 Mon Sep 17 00:00:00 2001 From: Nathaniel Manista Date: Tue, 19 Sep 2017 00:00:14 +0000 Subject: [PATCH] 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. --- src/compiler/python_generator.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/python_generator.cc b/src/compiler/python_generator.cc index a60b528e3b5..ef2d90de9e9 100644 --- a/src/compiler/python_generator.cc +++ b/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 {