aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar kpayson64 <kpayson@google.com>2017-06-09 13:06:40 -0700
committerGravatar GitHub <noreply@github.com>2017-06-09 13:06:40 -0700
commitc7d9c804966d12d852d08f4f132c716846a10ece (patch)
tree0ce906317d13d2d1356ed29d843e95c79b486a8f /src
parent5b67e80927b5d8eca0d74cf0586fad2cf42bbe7d (diff)
parentea3a125517b8d9f7f51ec9374a71a64e47714bc2 (diff)
Merge pull request #11400 from kpayson64/python_generator_fix
Fix python compiler for filenames with dashes
Diffstat (limited to 'src')
-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 1a06d0f21e..31b177c28e 100644
--- a/src/compiler/python_generator.cc
+++ b/src/compiler/python_generator.cc
@@ -756,6 +756,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 {