On Thu, Jul 22, 2010 at 12:36:27AM -0700, Nico Raffo wrote:
> If Vim is compiled with both --enable-pythoninterp and --enable-
> python3interp, errors occur when importing many python modules. To
> reproduce, compile as described then try something like:
> 
> :py import termios
> or
> :py3 import termios
> 
> Which gives the error:
> 
> ImportError: /usr/lib/python3.1/lib-dynload/termios.so: undefined
> symbol: PyExc_TypeError
> 
> This doesn't happen with all modules. Mostly just those with odd .so
> files.

I had been meaning to check whether something like that would happen with the
Python interfaces.  I saw something similar when testing the Perl interface.
Does the attached patch fix it?

-- 
James
GPG Key: 1024D/61326D40 2003-09-02 James Vega <[email protected]>
diff --git a/src/if_python.c b/src/if_python.c
--- a/src/if_python.c
+++ b/src/if_python.c
@@ -96,11 +96,11 @@
 #  define HINSTANCE long_u		/* for generating prototypes */
 # endif
 
-#ifndef _WIN32
+#ifndef WIN3264
 # include <dlfcn.h>
 # define FARPROC void*
 # define HINSTANCE void*
-# define load_dll(n) dlopen((n),RTLD_LAZY)
+# define load_dll(n) dlopen((n),RTLD_LAZY|RTLD_GLOBAL)
 # define close_dll dlclose
 # define symbol_from_dll dlsym
 #else
diff --git a/src/if_python3.c b/src/if_python3.c
--- a/src/if_python3.c
+++ b/src/if_python3.c
@@ -70,11 +70,11 @@
 
 #if defined(DYNAMIC_PYTHON3)
 
-#ifndef _WIN32
+#ifndef WIN3264
 #include <dlfcn.h>
 #define FARPROC void*
 #define HINSTANCE void*
-#define load_dll(n) dlopen((n),RTLD_LAZY)
+#define load_dll(n) dlopen((n),RTLD_LAZY|RTLD_GLOBAL)
 #define close_dll dlclose
 #define symbol_from_dll dlsym
 #else

Attachment: signature.asc
Description: Digital signature

Raspunde prin e-mail lui