Reply to message «Re: :python forwarding to :py3 and vice-versa in case of incompatibility», sent 15:57:44 23 August 2011, Tuesday by Roland Puntaier:
> Here I meant the scenario, where we would go without loading the python
> shared object (SO).
> Then we would have to do a AC_DEFINE() in the configure.in with the
> version.
> In that scenario has('python3') would not load the SO, but since
> configured, would return true.
I suggest seeking for more information at this point: at least, check whether
python3 so or, especially, DLL exists and only then return true. Especially
because if I am not mistaking, vim without cream is compiled with py3 support,
but this does not guarantee that :py3 will actually work (in my Gentoo adding
python USE flag to vim will also install python, so this is not a problem).
Won't the following work: fork and load library in child, then make it report
about errors and exit?
>
> :python would load python2 SO, because also configure.
>
> Now has('python3'), which would take into account that both cannot run
> in the same instance, would return false.
Original message:
> On 08/22/2011 10:11 PM, Bram Moolenaar wrote:
> > Roland Puntaier wrote:
> >>> This still has the problem that just checking for python or python3
> >>> being available loads the library before knowing what version it is.
> >>> Thus a plugin checking for python causes python to be loaded and
> >>> thereby disabling python3.
> >>>
> >>> Perhaps we don't care? At least the user can put has('python3') in his
> >>> vimrc to force loading the preferred version.
> >>
> >> This is fine.
> >>
> >> The other solution with a configure define would have another problem:
> >> has('python3')
> >> python
> >> has('python3')
> >> The first time it would be true and the second time false.
> >
> > I don't think so. Did you try it? For me the python command fails.
>
> Here I meant the scenario, where we would go without loading the python
> shared object (SO).
> Then we would have to do a AC_DEFINE() in the configure.in with the
> version.
> In that scenario has('python3') would not load the SO, but since
> configured, would return true.
>
> :python would load python2 SO, because also configure.
>
> Now has('python3'), which would take into account that both cannot run
> in the same instance, would return false.
>
> >> The change in python.vim and vim.vim would be good to have, too.
> >> I'm not familiar with aap, so that change was just to make you give it a
> >> thought.
> >
> > The problem is that checking with has() actually loads that python
> > version and may prevent the other to load.
>
> I did understand that. I said that this is fine, i.e. no problem,
> because the user can put a has('python3') or has('python') or a
> python/py3 command into his vimrc.
> I basically agreed to your 'Perhaps we don't care? ...',
>
> Will you take over the changes in python.vim and vim.vim as well?
>
> Sorry, for not expressing myself well.
>
> Roland
signature.asc
Description: This is a digitally signed message part.
