mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 10:48:51 +00:00
THRIFT-3230: transform typedef when getting type name
Client: Python Patch: 软件工程师李飛 <lifei@7v1.net> This closes #545 Python compiler generates wrong code if there is function throwing a typedef of exception with another namespace. We should use the real type name instead of the name of typedef.
This commit is contained in:
parent
90c60e340c
commit
01a77ab01e
@ -2339,6 +2339,10 @@ string t_py_generator::argument_list(t_struct* tstruct, vector<string>* pre, vec
|
||||
}
|
||||
|
||||
string t_py_generator::type_name(t_type* ttype) {
|
||||
while (ttype->is_typedef()) {
|
||||
ttype = ((t_typedef*)ttype)->get_type();
|
||||
}
|
||||
|
||||
t_program* program = ttype->get_program();
|
||||
if (ttype->is_service()) {
|
||||
return get_real_py_module(program, gen_twisted_) + "." + ttype->get_name();
|
||||
|
Loading…
Reference in New Issue
Block a user