Skip to content

Commit

Permalink
THRIFT-1857 Python 3.X Support - Replace deprecated "," with "as" in …
Browse files Browse the repository at this point in the history
…python exception generation code.

Patch: George Leslie-Waksman
This closes apache#440
  • Loading branch information
bufferoverflow committed Apr 14, 2015
1 parent 60101f8 commit 9edb090
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler/cpp/src/generate/t_py_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1701,7 +1701,7 @@ void t_py_generator::generate_process_function(t_service* tservice, t_function*
// Kinda absurd
f_service_ << indent() << " error.raiseException()" << endl;
for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
f_service_ << indent() << "except " << type_name((*x_iter)->get_type()) << ", "
f_service_ << indent() << "except " << type_name((*x_iter)->get_type()) << " as "
<< (*x_iter)->get_name() << ":" << endl;
if (!tfunction->is_oneway()) {
indent_up();
Expand Down Expand Up @@ -1773,7 +1773,7 @@ void t_py_generator::generate_process_function(t_service* tservice, t_function*
if (!tfunction->is_oneway() && xceptions.size() > 0) {
indent_down();
for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
f_service_ << indent() << "except " << type_name((*x_iter)->get_type()) << ", "
f_service_ << indent() << "except " << type_name((*x_iter)->get_type()) << " as "
<< (*x_iter)->get_name() << ":" << endl;
if (!tfunction->is_oneway()) {
indent_up();
Expand Down Expand Up @@ -1828,7 +1828,7 @@ void t_py_generator::generate_process_function(t_service* tservice, t_function*
if (!tfunction->is_oneway() && xceptions.size() > 0) {
indent_down();
for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
f_service_ << indent() << "except " << type_name((*x_iter)->get_type()) << ", "
f_service_ << indent() << "except " << type_name((*x_iter)->get_type()) << " as "
<< (*x_iter)->get_name() << ":" << endl;
if (!tfunction->is_oneway()) {
indent_up();
Expand Down

0 comments on commit 9edb090

Please sign in to comment.