[Xapian-tickets] [Xapian] #731: Python bindings don't work out of the box
Xapian
nobody at xapian.org
Mon Aug 8 00:43:53 BST 2016
#731: Python bindings don't work out of the box
--------------------------------------+--------------------------
Reporter: james | Owner: james
Type: defect | Status: new
Priority: normal | Milestone: 1.4.1
Component: Xapian-bindings (Python) | Version: 1.4.0
Severity: critical | Resolution:
Keywords: | Blocked By:
Blocking: | Operating System: All
--------------------------------------+--------------------------
Comment (by olly):
I wonder if we should just replace the setup code wholesale - it's
needlessly complicated for our needs, as we just want a wrapper than works
for Python3 and a different one which works for 2.6 and 2.7, so all the
code to check versions is just pointless complication and overhead.
Changing it to the following works for me (along with splitting the
imports as you did in the patch):
{{{
#!python
new_instancemethod = lambda func, inst, cls:
_xapian.SWIG_PyInstanceMethod_New(func)
from . import _xapian
_swig_property = property
import builtins as __builtin__
}}}
For Python2 the following works for 2.7 and I think will also for 2.6:
{{{
#!python
from new import instancemethod as new_instancemethod
from . import _xapian
_swig_property = property
import __builtin__
}}}
--
Ticket URL: <https://trac.xapian.org/ticket/731#comment:3>
Xapian <//xapian.org/>
Xapian
More information about the Xapian-tickets
mailing list