summaryrefslogtreecommitdiffstats
path: root/Python/import.c
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-08-02 04:15:00 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-08-02 04:15:00 (GMT)
commit6d6c1a35e08b95a83dbe47dbd9e6474daff00354 (patch)
tree542089077b9c2650dcf5c52d6bfcef1baf12d176 /Python/import.c
parent52d55a392600011d3edfe85c694744ec550ad1fe (diff)
downloadcpython-6d6c1a35e08b95a83dbe47dbd9e6474daff00354.zip
cpython-6d6c1a35e08b95a83dbe47dbd9e6474daff00354.tar.gz
cpython-6d6c1a35e08b95a83dbe47dbd9e6474daff00354.tar.bz2
Merge of descr-branch back into trunk.
Diffstat (limited to 'Python/import.c')
-rw-r--r--Python/import.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/Python/import.c b/Python/import.c
index 82524f6..a2106de 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -43,7 +43,7 @@ extern time_t PyOS_GetLastModificationTime(char *, FILE *);
/* 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 @@ PyImport_Import(PyObject *module_name)
}
/* 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)