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-declarationrelease/4.3a0
parent
d9d97c4bc7
commit
189ce33e1d
|
@ -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";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue