Mercurial > cpython-lru_cache-weakref
diff Python/import.c @ 14232:1f1a156ed5af legacy-trunk
Replace the run-time 'future-bytecode-stream-inspection' hack to find out
how 'import' was called with a compiletime mechanism: create either a tuple
of the import arguments, or None (in the case of a normal import), add it to
the code-block constants, and load it onto the stack before calling
IMPORT_NAME.
| author | Thomas Wouters <thomas@python.org> |
|---|---|
| date | Sun, 27 Aug 2000 20:31:27 +0000 |
| parents | 1b9fd0cbd914 |
| children | 6f6f965c5e2d |
line wrap: on
line diff
--- a/Python/import.c Sun Aug 27 20:18:17 2000 +0000 +++ b/Python/import.c Sun Aug 27 20:31:27 2000 +0000 @@ -66,7 +66,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 (50822 | ((long)'\r'<<16) | ((long)'\n'<<24)) +#define MAGIC (50823 | ((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 @@ -1401,7 +1401,7 @@ { static PyObject *fromlist = NULL; if (fromlist == NULL && strchr(name, '.') != NULL) { - fromlist = Py_BuildValue("[s]", "*"); + fromlist = Py_BuildValue("(s)", "*"); if (fromlist == NULL) return NULL; }
