Repository: thrift Updated Branches: refs/heads/master eb393ac3c -> 03394b54f
THRIFT-2662: py - Fix incorrect indentation when oneway function is used Client: Python-Compiler Patch: Dustin Spicuzza fixes python generator when py:tornado option is enabled This closes #186 Project: http://git-wip-us.apache.org/repos/asf/thrift/repo Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/03394b54 Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/03394b54 Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/03394b54 Branch: refs/heads/master Commit: 03394b54fb9a7e43b41299ee3886ae4fabb7fb64 Parents: eb393ac Author: Konrad Grochowski <[email protected]> Authored: Tue Aug 12 17:48:44 2014 -0400 Committer: Konrad Grochowski <[email protected]> Committed: Mon Sep 29 23:04:30 2014 +0200 ---------------------------------------------------------------------- compiler/cpp/src/generate/t_py_generator.cc | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/thrift/blob/03394b54/compiler/cpp/src/generate/t_py_generator.cc ---------------------------------------------------------------------- diff --git a/compiler/cpp/src/generate/t_py_generator.cc b/compiler/cpp/src/generate/t_py_generator.cc index 2b5725f..e6d7bdd 100644 --- a/compiler/cpp/src/generate/t_py_generator.cc +++ b/compiler/cpp/src/generate/t_py_generator.cc @@ -2043,17 +2043,14 @@ void t_py_generator::generate_process_function(t_service* tservice, } } - // Shortcut out here for oneway functions - if (tfunction->is_oneway()) { - return; + if (!tfunction->is_oneway()) { + f_service_ << + indent() << "oprot.writeMessageBegin(\"" << tfunction->get_name() << "\", TMessageType.REPLY, seqid)" << endl << + indent() << "result.write(oprot)" << endl << + indent() << "oprot.writeMessageEnd()" << endl << + indent() << "oprot.trans.flush()" << endl; } - f_service_ << - indent() << "oprot.writeMessageBegin(\"" << tfunction->get_name() << "\", TMessageType.REPLY, seqid)" << endl << - indent() << "result.write(oprot)" << endl << - indent() << "oprot.writeMessageEnd()" << endl << - indent() << "oprot.trans.flush()" << endl; - // Close function indent_down(); f_service_ << endl;
