Mercurial > vim
comparison src/if_python.c @ 2384:aeea25941392 vim73
Temporary solution for crashing when using both :py and :py3: disallow both in
one session.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sat, 24 Jul 2010 15:42:14 +0200 |
parents | f414e5a4b40e |
children | 76f0c4918f5c |
comparison
equal
deleted
inserted
replaced
2383:410d7b5916f9 | 2384:aeea25941392 |
---|---|
341 static int | 341 static int |
342 python_runtime_link_init(char *libname, int verbose) | 342 python_runtime_link_init(char *libname, int verbose) |
343 { | 343 { |
344 int i; | 344 int i; |
345 | 345 |
346 #if defined(UNIX) && defined(FEAT_PYTHON3) | |
347 /* Can't have Python and Python3 loaded at the same time, it may cause a | |
348 * crash. */ | |
349 if (python3_loaded()) | |
350 { | |
351 EMSG(_("E999: Python: Cannot use :py and :py3 in one session")); | |
352 return FAIL; | |
353 } | |
354 #endif | |
355 | |
346 if (hinstPython) | 356 if (hinstPython) |
347 return OK; | 357 return OK; |
348 hinstPython = load_dll(libname); | 358 hinstPython = load_dll(libname); |
349 if (!hinstPython) | 359 if (!hinstPython) |
350 { | 360 { |
516 } | 526 } |
517 #endif | 527 #endif |
518 | 528 |
519 --recurse; | 529 --recurse; |
520 } | 530 } |
531 | |
532 #if (defined(DYNAMIC_PYTHON) && defined(FEAT_PYTHON3)) || defined(PROTO) | |
533 int | |
534 python_loaded() | |
535 { | |
536 return (hinstPython != 0); | |
537 } | |
538 #endif | |
521 | 539 |
522 static int | 540 static int |
523 Python_Init(void) | 541 Python_Init(void) |
524 { | 542 { |
525 if (!initialised) | 543 if (!initialised) |