The old version of type_name did not fully qualify parent service names
when they were defined in the same IDL file, but it is necessary because
they end up in different Python files.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@741833
13f79535-47bb-0310-9956-
ffa450edef68
string t_py_generator::type_name(t_type* ttype) {
t_program* program = ttype->get_program();
+ if (ttype->is_service()) {
+ return get_real_py_module(program) + "." + ttype->get_name();
+ }
if (program != NULL && program != program_) {
- if (ttype->is_service()) {
- return get_real_py_module(program) + "." + ttype->get_name();
- } else {
- return get_real_py_module(program) + ".ttypes." + ttype->get_name();
- }
+ return get_real_py_module(program) + ".ttypes." + ttype->get_name();
}
return ttype->get_name();
}
i32 Janky(i32 arg)
}
+service Inherited extends Srv {
+ i32 identity(i32 arg)
+}
+
service EmptyService {}
// The only purpose of this thing is to increase the size of the generated code
# Just import these generated files to make sure they are syntactically valid
from DebugProtoTest import EmptyService
+from DebugProtoTest import Inherited