diff -rbup Python-2.5.1-orig/Python/ast.c Python-2.5.1/Python/ast.c --- Python-2.5.1-orig/Python/ast.c 2007-03-16 00:12:48.000000000 -0400 +++ Python-2.5.1/Python/ast.c 2007-07-10 17:06:00.000000000 -0400 @@ -3113,6 +3113,10 @@ decode_utf8(const char **sPtr, const cha static PyObject * decode_unicode(const char *s, size_t len, int rawmode, const char *encoding) { +#ifndef Py_USING_UNICODE + Py_FatalError("decode_unicode should not be called in this build."); + return NULL; +#else PyObject *v, *u; char *buf; char *p; @@ -3170,6 +3174,7 @@ decode_unicode(const char *s, size_t len v = PyUnicode_DecodeUnicodeEscape(s, len, NULL); Py_XDECREF(u); return v; +#endif } /* s is a Python string literal, including the bracketing quote characters, diff -rbup Python-2.5.1-orig/Python/import.c Python-2.5.1/Python/import.c --- Python-2.5.1-orig/Python/import.c 2007-03-13 19:04:29.000000000 -0400 +++ Python-2.5.1/Python/import.c 2007-07-10 17:02:25.000000000 -0400 @@ -117,15 +117,20 @@ _PyImport_Init(void) /* 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;