From ea3a125517b8d9f7f51ec9374a71a64e47714bc2 Mon Sep 17 00:00:00 2001 From: Ken Payson Date: Fri, 2 Jun 2017 16:58:22 -0700 Subject: [PATCH] Fix python compiler for filenames with dashes --- src/compiler/python_generator.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/compiler/python_generator.cc b/src/compiler/python_generator.cc index 278e5072b26..afa4c403448 100644 --- a/src/compiler/python_generator.cc +++ b/src/compiler/python_generator.cc @@ -771,6 +771,7 @@ bool PythonGrpcGenerator::Generate(const FileDescriptor* file, file->name().find_last_of(".proto") == file->name().size() - 1) { grpc::string base = file->name().substr(0, file->name().size() - proto_suffix_length); + std::replace(base.begin(), base.end(), '-', '_'); pb2_file_name = base + "_pb2.py"; pb2_grpc_file_name = base + "_pb2_grpc.py"; } else {