Skip to content
Snippets Groups Projects
Commit c7d9c804 authored by kpayson64's avatar kpayson64 Committed by GitHub
Browse files

Merge pull request #11400 from kpayson64/python_generator_fix

Fix python compiler for filenames with dashes
parents 5b67e809 ea3a1255
No related branches found
No related tags found
No related merge requests found
...@@ -756,6 +756,7 @@ bool PythonGrpcGenerator::Generate(const FileDescriptor* file, ...@@ -756,6 +756,7 @@ bool PythonGrpcGenerator::Generate(const FileDescriptor* file,
file->name().find_last_of(".proto") == file->name().size() - 1) { file->name().find_last_of(".proto") == file->name().size() - 1) {
grpc::string base = grpc::string base =
file->name().substr(0, file->name().size() - proto_suffix_length); file->name().substr(0, file->name().size() - proto_suffix_length);
std::replace(base.begin(), base.end(), '-', '_');
pb2_file_name = base + "_pb2.py"; pb2_file_name = base + "_pb2.py";
pb2_grpc_file_name = base + "_pb2_grpc.py"; pb2_grpc_file_name = base + "_pb2_grpc.py";
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment