On Fri, Jul 23, 2010 at 02:30:19PM -0400, James Vega wrote:

Because we have to use RTLD_GLOBAL (since the C extensions aren't linked
against libpython), it's not safe to use both the Python 2 & 3
This seems to be system dependent then. On my system the original example worked fine before the patch and I can also use python2 and 3 in the same vim session (just checked with the current hg head and manually removed the RTLD_GLOBAL)

Running ldd on the files in the lib-dynload directory reveals that out of my installed python versions (2.4.6, 2.5.4, 2.6.5, 2.7, 3.1.2) revealed that all c-extensions except those for 2.4.6 are linked against the corresponding libpython.so

interfaces in the same session of Vim.  It looks like the options are
either:

1) Only allow one interface to be enabled at a time.
2) Keep track of whether one of the Python interfaces has been
  initialized and error out if the other one tries to be initialized.

I'd personally prefer the latter since that still allows one to build a
single Vim binary that supports both Python 2 & 3, but only one of the
interfaces can be used per Vim session.

Given my above observations the "with cherry on top" solution might be 2) + a configure time check to see whether RTLD_GLOBAL and thus this restriction is necessary at all. However I'm not sure if the added complexity would be worth it.
Regards,
Andy
--
Be nice to people on the way up, because you'll meet them on your way down.
                -- Wilson Mizner

Attachment: pgpu6D0P11bqy.pgp
Description: PGP signature

Raspunde prin e-mail lui