Index: python/generate-python-exceptions
===================================================================
--- python/generate-python-exceptions	(revision 13525)
+++ python/generate-python-exceptions	(working copy)
@@ -43,6 +43,15 @@
     serialise
 );
 
+my @weight_virtual_methods = qw(
+    init
+    name
+    get_sumpart
+    get_maxpart
+    get_sumextra
+    get_maxextra
+);
+
 open FD, ">except.i" or die $!;
 
 print FD <<"EOF";
@@ -181,6 +190,19 @@
 EOF
 }
 
+for my $method (@weight_virtual_methods) {
+    print FD <<"EOF";
+%exception Xapian::Weight::${method} {
+    try {
+	\$action
+    } catch (...) {
+	Xapian::SetPythonException();
+	SWIG_fail;
+    }
+}
+EOF
+}
+
 print FD <<'EOF';
 %exception Xapian::Stopper::get_description {
     try {
Index: xapian.i
===================================================================
--- xapian.i	(revision 13525)
+++ xapian.i	(working copy)
@@ -456,21 +456,7 @@
 %ignore Xapian::Registry::operator=;
 %include <xapian/registry.h>
 
-/* Generated code won't compile if directors are enabled.  Disable for now
- * while we investigate.
- *
- * The problem comes from having a private pure virtual clone() function in
- * the Weight class. Directors work by multiple inheritance from both
- * SWIG_Director and the class they're directing; constructors in the target
- * language are then redirected to the director class. However the director
- * mechanism doesn't generate a wrapper for the clone() function (presumably
- * because it's private). This is wrong, because the director is then
- * abstract, which the SWIG generated code can't cope with.
- *
- * Also having a factory method might be a problem?
- */
-
-//%feature("director") Weight;
+%feature("director") Weight;
 %ignore Xapian::Weight::Internal;
 %ignore Xapian::Weight::operator=;
 %ignore Xapian::Weight::Weight(const Weight &);
