fix error on GRPC Python - ignore namespace tree if not specified (#5862) (#5922)

This commit is contained in:
Malar Kannan
2020-06-08 22:48:46 +05:30
committed by GitHub
parent 108e981dbe
commit 7ac0264053

View File

@@ -403,8 +403,10 @@ bool GeneratePythonGRPC(const Parser &parser, const std::string & /*path*/,
namespace_dir += *it;
}
std::string grpc_py_filename =
namespace_dir + kPathSeparator + file_name + "_grpc_fb.py";
std::string grpc_py_filename = namespace_dir;
if (!namespace_dir.empty()) grpc_py_filename += kPathSeparator;
grpc_py_filename += file_name + "_grpc_fb.py";
return flatbuffers::SaveFile(grpc_py_filename.c_str(), code, false);
}