Support exceptions so ipython/python can catch and doesn't crash. Trade constness with exception since Cython doesn't allow both.

See: http://stackoverflow.com/questions/26904268/cython-both-const-and-except-in-c-method-declaration
release/4.3a0
Duy-Nguyen Ta 2016-12-19 17:53:14 -05:00
parent d9d97c4bc7
commit 189ce33e1d
3 changed files with 4 additions and 3 deletions

View File

@ -89,7 +89,8 @@ void Method::emit_cython_pxd(FileWriter& file, const Class& cls) const {
<< "(";
argumentList(i).emit_cython_pxd(file, cls.pxdClassName(), cls.templateArgs);
file.oss << ")";
if (is_const_) file.oss << " const";
// if (is_const_) file.oss << " const";
file.oss << " except +";
file.oss << "\n";
}
}

View File

@ -65,7 +65,7 @@ void StaticMethod::emit_cython_pxd(FileWriter& file, const Class& cls) const {
returnVals_[i].emit_cython_pxd(file, cls.pxdClassName(), cls.templateArgs);
file.oss << name_ + ((i>0)?"_" + to_string(i):"") << " \"" << name_ << "\"" << "(";
argumentList(i).emit_cython_pxd(file, cls.pxdClassName(), cls.templateArgs);
file.oss << ")\n";
file.oss << ") except +\n";
}
}

View File

@ -29,7 +29,7 @@ void TemplateMethod::emit_cython_pxd(FileWriter& file, const Class& cls) const {
returnVals_[i].emit_cython_pxd(file, cls.pxdClassName(), templateArgs);
file.oss << name_ << "[" << argName << "]" << "(";
argumentList(i).emit_cython_pxd(file, cls.pxdClassName(), templateArgs);
file.oss << ")\n";
file.oss << ") except +\n";
}
}