aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/compiler/python_generator.cc
diff options
context:
space:
mode:
authorGravatar Ken Payson <kpayson@google.com>2017-06-02 16:58:22 -0700
committerGravatar Ken Payson <kpayson@google.com>2017-06-02 16:58:22 -0700
commitea3a125517b8d9f7f51ec9374a71a64e47714bc2 (patch)
tree4b11eb999f85a041e2cc75e29615f85ebb83895e /src/compiler/python_generator.cc
parent01b536c3e74609273ec4042ddb158be32c3fc6c7 (diff)
Fix python compiler for filenames with dashes
Diffstat (limited to 'src/compiler/python_generator.cc')
-rw-r--r--src/compiler/python_generator.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/compiler/python_generator.cc b/src/compiler/python_generator.cc
index 278e5072b2..afa4c40344 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 {