]> granicus.if.org Git - python/commitdiff
One last rename glitch: import_modules -> _PyImport_Modules.
authorGuido van Rossum <guido@python.org>
Wed, 14 May 1997 17:36:12 +0000 (17:36 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 14 May 1997 17:36:12 +0000 (17:36 +0000)
Python/import.c
Python/importdl.c
Python/importdl.h

index f2d80401d6acf73d0b4dc6a31a839f7035c2c9f0..e44dc8c264d27e0463b68b720a03fcf6d9cde223 100644 (file)
@@ -61,7 +61,7 @@ extern long PyOS_GetLastModificationTime(); /* In getmtime.c */
 /* New way to come up with the magic number: (YEAR-1995), MONTH, DAY */
 #define MAGIC (20121 | ((long)'\r'<<16) | ((long)'\n'<<24))
 
-PyObject *import_modules; /* This becomes sys.modules */
+PyObject *_PyImport_Modules; /* This becomes sys.modules */
 
 
 /* Initialize things */
@@ -69,9 +69,9 @@ PyObject *import_modules; /* This becomes sys.modules */
 void
 PyImport_Init()
 {
-       if (import_modules != NULL)
+       if (_PyImport_Modules != NULL)
                Py_FatalError("duplicate initimport() call");
-       if ((import_modules = PyDict_New()) == NULL)
+       if ((_PyImport_Modules = PyDict_New()) == NULL)
                Py_FatalError("no mem for dictionary of modules");
        if (Py_OptimizeFlag) {
                /* Replace ".pyc" with ".pyo" in import_filetab */
@@ -89,9 +89,9 @@ PyImport_Init()
 void
 PyImport_Cleanup()
 {
-       if (import_modules != NULL) {
-               PyObject *tmp = import_modules;
-               import_modules = NULL;
+       if (_PyImport_Modules != NULL) {
+               PyObject *tmp = _PyImport_Modules;
+               _PyImport_Modules = NULL;
                /* This deletes all modules from sys.modules.
                   When a module is deallocated, it in turn clears its
                   dictionary, thus hopefully breaking any circular
@@ -118,7 +118,7 @@ PyImport_GetMagicNumber()
 PyObject *
 PyImport_GetModuleDict()
 {
-       return import_modules;
+       return _PyImport_Modules;
 }
 
 
@@ -134,18 +134,18 @@ PyImport_AddModule(name)
 {
        PyObject *m;
 
-       if (import_modules == NULL) {
+       if (_PyImport_Modules == NULL) {
                PyErr_SetString(PyExc_SystemError,
                                "sys.modules has been deleted");
                return NULL;
        }
-       if ((m = PyDict_GetItemString(import_modules, name)) != NULL &&
+       if ((m = PyDict_GetItemString(_PyImport_Modules, name)) != NULL &&
            PyModule_Check(m))
                return m;
        m = PyModule_New(name);
        if (m == NULL)
                return NULL;
-       if (PyDict_SetItemString(import_modules, name, m) != 0) {
+       if (PyDict_SetItemString(_PyImport_Modules, name, m) != 0) {
                Py_DECREF(m);
                return NULL;
        }
@@ -661,12 +661,12 @@ PyImport_ImportModule(name)
 {
        PyObject *m;
 
-       if (import_modules == NULL) {
+       if (_PyImport_Modules == NULL) {
                PyErr_SetString(PyExc_SystemError,
                                "sys.modules has been deleted");
                return NULL;
        }
-       if ((m = PyDict_GetItemString(import_modules, name)) != NULL) {
+       if ((m = PyDict_GetItemString(_PyImport_Modules, name)) != NULL) {
                Py_INCREF(m);
        }
        else {
@@ -675,7 +675,7 @@ PyImport_ImportModule(name)
                    (i = PyImport_ImportFrozenModule(name))) {
                        if (i < 0)
                                return NULL;
-                       if ((m = PyDict_GetItemString(import_modules,
+                       if ((m = PyDict_GetItemString(_PyImport_Modules,
                                                      name)) == NULL) {
                            if (PyErr_Occurred() == NULL)
                                PyErr_SetString(PyExc_SystemError,
@@ -710,12 +710,12 @@ PyImport_ReloadModule(m)
        name = PyModule_GetName(m);
        if (name == NULL)
                return NULL;
-       if (import_modules == NULL) {
+       if (_PyImport_Modules == NULL) {
                PyErr_SetString(PyExc_SystemError,
                                "sys.modules has been deleted");
                return NULL;
        }
-       if (m != PyDict_GetItemString(import_modules, name)) {
+       if (m != PyDict_GetItemString(_PyImport_Modules, name)) {
                PyErr_SetString(PyExc_ImportError,
                                "reload() module not in sys.modules");
                return NULL;
index 33c0e5df0c730c813cf828934b7006839b70926e..436a8de53372b8b8487cf46a52563114946502a6 100644 (file)
@@ -527,7 +527,7 @@ _PyImport_LoadDynamicModule(name, pathname, fp)
        (*p)();
        /* XXX Need check for err_occurred() here */
 
-       m = PyDict_GetItemString(import_modules, name);
+       m = PyDict_GetItemString(_PyImport_Modules, name);
        if (m == NULL) {
                if (PyErr_Occurred() == NULL)
                        PyErr_SetString(PyExc_SystemError,
index 48aa1a44f5ecb7c733ae273aa6796cbae72c71b9..f1bdeab8be3d86662bcd922e4614727c19e19c4b 100644 (file)
@@ -42,7 +42,7 @@ extern struct filedescr {
        enum filetype type;
 } _PyImport_Filetab[];
 
-extern PyObject *import_modules;
+extern PyObject *_PyImport_Modules;
 
 extern PyObject *_PyImport_LoadDynamicModule
        Py_PROTO((char *name, char *pathname, FILE *));