diff Python/import.c @ 18933:09df3254b49d legacy-trunk

Merge of descr-branch back into trunk.
author Tim Peters <tim.peters@gmail.com>
date Thu, 02 Aug 2001 04:15:00 +0000
parents a8b1acc7a21f
children 7fa1f87ca6b2
line wrap: on
line diff
--- a/Python/import.c	Wed Aug 01 21:44:14 2001 +0000
+++ b/Python/import.c	Thu Aug 02 04:15:00 2001 +0000
@@ -43,7 +43,7 @@
 /* XXX Perhaps the magic number should be frozen and a version field
    added to the .pyc file header? */
 /* New way to come up with the magic number: (YEAR-1995), MONTH, DAY */
-#define MAGIC (60420 | ((long)'\r'<<16) | ((long)'\n'<<24))
+#define MAGIC (60717 | ((long)'\r'<<16) | ((long)'\n'<<24))
 
 /* Magic word as global; note that _PyImport_Init() can change the
    value of this global to accommodate for alterations of how the
@@ -1968,8 +1968,11 @@
 	}
 
 	/* Get the __import__ function from the builtins */
-	if (PyDict_Check(builtins))
+	if (PyDict_Check(builtins)) {
 		import = PyObject_GetItem(builtins, import_str);
+		if (import == NULL)
+			PyErr_SetObject(PyExc_KeyError, import_str);
+	}
 	else
 		import = PyObject_GetAttr(builtins, import_str);
 	if (import == NULL)