diff options
author | Guido van Rossum <guido@python.org> | 1997-10-31 18:37:24 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-10-31 18:37:24 (GMT) |
commit | 771c6c8f7a834baf41ea73914a13835325718fa9 (patch) | |
tree | 98aba465423427a274b0b2413900e9b737740207 /Python/import.c | |
parent | 66959aff6831b5ce6ecc2a9a8d38041198b355aa (diff) | |
download | cpython-771c6c8f7a834baf41ea73914a13835325718fa9.zip cpython-771c6c8f7a834baf41ea73914a13835325718fa9.tar.gz cpython-771c6c8f7a834baf41ea73914a13835325718fa9.tar.bz2 |
Instead of using _PyImport_Inittab[] directly, use the new "official"
pointer *PyImport_Inittab which is initialized to _PyImport_Inittab.
Diffstat (limited to 'Python/import.c')
-rw-r--r-- | Python/import.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Python/import.c b/Python/import.c index 465397c..9f68c62 100644 --- a/Python/import.c +++ b/Python/import.c @@ -80,6 +80,10 @@ extern long PyOS_GetLastModificationTime(); /* In getmtime.c */ /* See _PyImport_FixupExtension() below */ static PyObject *extensions = NULL; +/* This table is defined in config.c: */ +extern struct _inittab _PyImport_Inittab[]; + +struct _inittab *PyImport_Inittab = _PyImport_Inittab; /* Initialize things */ @@ -612,9 +616,9 @@ is_builtin(name) char *name; { int i; - for (i = 0; _PyImport_Inittab[i].name != NULL; i++) { - if (strcmp(name, _PyImport_Inittab[i].name) == 0) { - if (_PyImport_Inittab[i].initfunc == NULL) + for (i = 0; PyImport_Inittab[i].name != NULL; i++) { + if (strcmp(name, PyImport_Inittab[i].name) == 0) { + if (PyImport_Inittab[i].initfunc == NULL) return -1; else return 1; @@ -871,7 +875,7 @@ init_builtin(name) if ((mod = _PyImport_FindExtension(name, name)) != NULL) return 1; - for (p = _PyImport_Inittab; p->name != NULL; p++) { + for (p = PyImport_Inittab; p->name != NULL; p++) { if (strcmp(name, p->name) == 0) { if (p->initfunc == NULL) { PyErr_Format(PyExc_ImportError, |