[Python-checkins] r57330 - python/branches/release25-maint/Python/ast.c python/branches/release25-maint/Python/import.c

georg.brandl python-checkins at python.org
Thu Aug 23 20:08:34 CEST 2007


Author: georg.brandl
Date: Thu Aug 23 20:08:33 2007
New Revision: 57330

Modified:
   python/branches/release25-maint/Python/ast.c
   python/branches/release25-maint/Python/import.c
Log:
Backport fix of #1752175.


Modified: python/branches/release25-maint/Python/ast.c
==============================================================================
--- python/branches/release25-maint/Python/ast.c	(original)
+++ python/branches/release25-maint/Python/ast.c	Thu Aug 23 20:08:33 2007
@@ -3115,6 +3115,7 @@
 #endif
 }
 
+#ifdef Py_USING_UNICODE
 static PyObject *
 decode_unicode(const char *s, size_t len, int rawmode, const char *encoding)
 {
@@ -3176,6 +3177,7 @@
 	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).

Modified: python/branches/release25-maint/Python/import.c
==============================================================================
--- python/branches/release25-maint/Python/import.c	(original)
+++ python/branches/release25-maint/Python/import.c	Thu Aug 23 20:08:33 2007
@@ -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


More information about the Python-checkins mailing list