Ticket #401: patch
File patch, 1.8 KB (added by , 15 years ago) |
---|
-
python/generate-python-exceptions
43 43 serialise 44 44 ); 45 45 46 my @weight_virtual_methods = qw( 47 init 48 name 49 get_sumpart 50 get_maxpart 51 get_sumextra 52 get_maxextra 53 ); 54 46 55 open FD, ">except.i" or die $!; 47 56 48 57 print FD <<"EOF"; … … 181 190 EOF 182 191 } 183 192 193 for my $method (@weight_virtual_methods) { 194 print FD <<"EOF"; 195 %exception Xapian::Weight::${method} { 196 try { 197 \$action 198 } catch (...) { 199 Xapian::SetPythonException(); 200 SWIG_fail; 201 } 202 } 203 EOF 204 } 205 184 206 print FD <<'EOF'; 185 207 %exception Xapian::Stopper::get_description { 186 208 try { -
xapian.i
456 456 %ignore Xapian::Registry::operator=; 457 457 %include <xapian/registry.h> 458 458 459 /* Generated code won't compile if directors are enabled. Disable for now 460 * while we investigate. 461 * 462 * The problem comes from having a private pure virtual clone() function in 463 * the Weight class. Directors work by multiple inheritance from both 464 * SWIG_Director and the class they're directing; constructors in the target 465 * language are then redirected to the director class. However the director 466 * mechanism doesn't generate a wrapper for the clone() function (presumably 467 * because it's private). This is wrong, because the director is then 468 * abstract, which the SWIG generated code can't cope with. 469 * 470 * Also having a factory method might be a problem? 471 */ 472 473 //%feature("director") Weight; 459 %feature("director") Weight; 474 460 %ignore Xapian::Weight::Internal; 475 461 %ignore Xapian::Weight::operator=; 476 462 %ignore Xapian::Weight::Weight(const Weight &);