summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-08-23 18:08:33 +0000
committerGeorg Brandl <georg@python.org>2007-08-23 18:08:33 +0000
commiteec47f35569f184924e851fdc64f67cd79ffd2e3 (patch)
tree3bfdff4a6f1c516967ba43bd7bb7d319e02c3204 /Python
parent7d108b8806e5c54db757948b312726dc4599596c (diff)
downloadcpython-git-eec47f35569f184924e851fdc64f67cd79ffd2e3.tar.gz
Backport fix of #1752175.
Diffstat (limited to 'Python')
-rw-r--r--Python/ast.c2
-rw-r--r--Python/import.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/Python/ast.c b/Python/ast.c
index 2a27b64698..c96c503542 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -3115,6 +3115,7 @@ decode_utf8(const char **sPtr, const char *end, char* encoding)
#endif
}
+#ifdef Py_USING_UNICODE
static PyObject *
decode_unicode(const char *s, size_t len, int rawmode, const char *encoding)
{
@@ -3176,6 +3177,7 @@ decode_unicode(const char *s, size_t len, int rawmode, const char *encoding)
Py_XDECREF(u);
return v;
}
+#endif
/* s is a Python string literal, including the bracketing quote characters,
* and r &/or u prefixes (if any), and embedded escape sequences (if any).
diff --git a/Python/import.c b/Python/import.c
index b35dea1927..4311352c1f 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -119,15 +119,19 @@ _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;
@@ -1366,7 +1370,7 @@ find_module(char *fullname, char *subname, PyObject *path, char *buf,
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