]> granicus.if.org Git - python/commitdiff
Shared libraries didn't quite work under AIX because of the change in
authorGuido van Rossum <guido@python.org>
Fri, 10 Oct 1997 17:40:00 +0000 (17:40 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 10 Oct 1997 17:40:00 +0000 (17:40 +0000)
status of the GNU readline interface.  Here's a patch, by Vladimir
Marangozov.

Python/importdl.c

index 3f715dec83dd5185e7eb09e67574ed9ed2829bea..fffe2654e7c5be0010339045de8bdcfadc7498a9 100644 (file)
@@ -599,6 +599,17 @@ aix_getoldmodules(modlistptr)
        ldiptr = (struct ld_info *)ldibuf;
        prevmodptr = NULL;
        do {
+               if (strstr(ldiptr->ldinfo_filename, "python") == NULL) {
+                       /*
+                       -- Extract only the modules containing "python" as a
+                       -- substring, like the "python[version]" executable or
+                       -- "libpython[version].a" in case python is embedded.
+                       */
+                       offset = (unsigned int)ldiptr->ldinfo_next;
+                       ldiptr = (struct ld_info *)((unsigned int)
+                                                   ldiptr + offset);
+                       continue;
+               }
                if ((modptr = (ModulePtr)malloc(sizeof(Module))) == NULL) {
                        PyErr_SetString(PyExc_ImportError, strerror(errno));
                        while (*modlistptr) {