Mercurial > cpython-lru_cache-weakref
diff Python/import.c @ 42736:ddefbdbdbcb5 2.5
Backport fix of #1752175.
| author | Georg Brandl <georg@python.org> |
|---|---|
| date | Thu, 23 Aug 2007 18:08:33 +0000 |
| parents | a3bf55a03f66 |
| children | 787b969d37f0 |
line wrap: on
line diff
--- a/Python/import.c Thu Aug 23 17:57:53 2007 +0000 +++ b/Python/import.c Thu Aug 23 18:08:33 2007 +0000 @@ -119,15 +119,19 @@ /* prepare _PyImport_Filetab: copy entries from _PyImport_DynLoadFiletab and _PyImport_StandardFiletab. */ +#ifdef HAVE_DYNAMIC_LOADING for (scan = _PyImport_DynLoadFiletab; scan->suffix != NULL; ++scan) ++countD; +#endif for (scan = _PyImport_StandardFiletab; scan->suffix != NULL; ++scan) ++countS; filetab = PyMem_NEW(struct filedescr, countD + countS + 1); if (filetab == NULL) Py_FatalError("Can't initialize import file table."); +#ifdef HAVE_DYNAMIC_LOADING memcpy(filetab, _PyImport_DynLoadFiletab, countD * sizeof(struct filedescr)); +#endif memcpy(filetab + countD, _PyImport_StandardFiletab, countS * sizeof(struct filedescr)); filetab[countD + countS].suffix = NULL; @@ -1366,7 +1370,7 @@ saved_namelen = namelen; #endif /* PYOS_OS2 */ for (fdp = _PyImport_Filetab; fdp->suffix != NULL; fdp++) { -#if defined(PYOS_OS2) +#if defined(PYOS_OS2) && defined(HAVE_DYNAMIC_LOADING) /* OS/2 limits DLLs to 8 character names (w/o extension) * so if the name is longer than that and its a
