File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -312,6 +312,7 @@ Fredrik Nehr
312312Chad Netzer
313313Max Neunh�ffer
314314George Neville-Neil
315+ Gustavo Niemeyer
315316Oscar Nierstrasz
316317Hrvoje Niksic
317318Bill Noon
Original file line number Diff line number Diff line change @@ -12,6 +12,10 @@ Core and builtins
1212
1313Extension modules
1414
15+ - dl is now build on every system that has dlfcn.h. Failure in case
16+ of sizeof(int)!=sizeof(long)!=sizeof(void*) is delayed until dl.open
17+ is called.
18+
1519Library
1620
1721- ftplib: to safeguard the user's privacy, anonymous login will use
Original file line number Diff line number Diff line change @@ -158,6 +158,13 @@ dl_open(PyObject *self, PyObject *args)
158158 char * name ;
159159 int mode ;
160160 PyUnivPtr * handle ;
161+ if (sizeof (int ) != sizeof (long ) ||
162+ sizeof (long ) != sizeof (char * )) {
163+ PyErr_SetString (PyExc_SystemError ,
164+ "module dl requires sizeof(int) == sizeof(long) == sizeof(char*)" );
165+ return NULL ;
166+ }
167+
161168 if (PyArg_Parse (args , "z" , & name ))
162169 mode = RTLD_LAZY ;
163170 else {
@@ -204,13 +211,6 @@ initdl(void)
204211{
205212 PyObject * m , * d , * x ;
206213
207- if (sizeof (int ) != sizeof (long ) ||
208- sizeof (long ) != sizeof (char * )) {
209- PyErr_SetString (PyExc_SystemError ,
210- "module dl requires sizeof(int) == sizeof(long) == sizeof(char*)" );
211- return ;
212- }
213-
214214 /* Initialize object type */
215215 Dltype .ob_type = & PyType_Type ;
216216
Original file line number Diff line number Diff line change @@ -567,6 +567,11 @@ def detect_modules(self):
567567 define_macros = expat_defs ,
568568 libraries = ['expat' ]) )
569569
570+ # Dynamic loading module
571+ dl_inc = find_file ('dlfcn.h' , [], inc_dirs )
572+ if dl_inc is not None :
573+ exts .append ( Extension ('dl' , ['dlmodule.c' ]) )
574+
570575 # Platform-specific libraries
571576 if platform == 'linux2' :
572577 # Linux-specific modules
You can’t perform that action at this time.
0 commit comments