comparison Python/import.c @ 1353:a6355c83578d legacy-trunk

* stdwinmodule.c (stdwin_done): interface to shutdown stdwin (now this is no longer done by config.c). * stdwinmodule.c (initstdwin), config.c (initall): get command line arguments from sys.argv instead of special-casing stdwin in config.c * import.c (get_module): fix core dump when foomodule.o does not define initfoo(). * ChangeLog: documented changes by Sjoerd.
author Guido van Rossum <guido@python.org>
date Mon, 18 Oct 1993 11:44:47 +0000
parents e149c77d173c
children 1808ca5d8883
comparison
equal deleted inserted replaced
1352:4d1a15fc4748 1353:a6355c83578d
189 { 189 {
190 void *handle = dlopen (namebuf, 1); 190 void *handle = dlopen (namebuf, 1);
191 p = (dl_funcptr) dlsym(handle, funcname); 191 p = (dl_funcptr) dlsym(handle, funcname);
192 } 192 }
193 #else 193 #else
194 if (verbose)
195 fprintf(stderr,
196 "import %s # dynamically loaded from \"%s\"\n",
197 name, namebuf);
194 p = dl_loadmod(argv0, namebuf, funcname); 198 p = dl_loadmod(argv0, namebuf, funcname);
195 #endif /* SUN_SHLIB */ 199 #endif /* SUN_SHLIB */
196 if (p == NULL) { 200 if (p == NULL) {
197 D(fprintf(stderr, "dl_loadmod failed\n")); 201 err_setstr(SystemError,
202 "dynamic module does not define init function");
203 return NULL;
198 } else { 204 } else {
199 if (verbose)
200 fprintf(stderr,
201 "import %s # dynamically loaded from \"%s\"\n",
202 name, namebuf);
203 (*p)(); 205 (*p)();
204 *m_ret = m = dictlookup(modules, name); 206 *m_ret = m = dictlookup(modules, name);
205 if (m == NULL) { 207 if (m == NULL) {
206 err_setstr(SystemError, 208 err_setstr(SystemError,
207 "dynamic module missing"); 209 "dynamic module not initialized properly");
208 return NULL; 210 return NULL;
209 } else { 211 } else {
210 D(fprintf(stderr, 212 D(fprintf(stderr,
211 "module %s loaded!\n", name)); 213 "module %s loaded!\n", name));
212 INCREF(None); 214 INCREF(None);