[Python-checkins] r54368 - python/trunk/Python/import.c

collin.winter python-checkins at python.org
Wed Mar 14 00:02:20 CET 2007


Author: collin.winter
Date: Wed Mar 14 00:02:15 2007
New Revision: 54368

Modified:
   python/trunk/Python/import.c
Log:
Inline PyImport_GetModulesReloading().

Modified: python/trunk/Python/import.c
==============================================================================
--- python/trunk/Python/import.c	(original)
+++ python/trunk/Python/import.c	Wed Mar 14 00:02:15 2007
@@ -340,16 +340,6 @@
 	return Py_None;
 }
 
-PyObject *
-PyImport_GetModulesReloading(void)
-{
-	PyInterpreterState *interp = PyThreadState_Get()->interp;
-	if (interp->modules_reloading == NULL)
-		Py_FatalError("PyImport_GetModulesReloading: "
-			      "no modules_reloading dictionary!");
-	return interp->modules_reloading;
-}
-
 static void
 imp_modules_reloading_clear(void)
 {
@@ -2420,7 +2410,8 @@
 PyObject *
 PyImport_ReloadModule(PyObject *m)
 {
-	PyObject *modules_reloading = PyImport_GetModulesReloading();
+	PyInterpreterState *interp = PyThreadState_Get()->interp;
+	PyObject *modules_reloading = interp->modules_reloading;
 	PyObject *modules = PyImport_GetModuleDict();
 	PyObject *path = NULL, *loader = NULL, *existing_m = NULL;
 	char *name, *subname;
@@ -2428,6 +2419,12 @@
 	struct filedescr *fdp;
 	FILE *fp = NULL;
 	PyObject *newm;
+    
+	if (modules_reloading == NULL) {
+		Py_FatalError("PyImport_ReloadModule: "
+							"no modules_reloading dictionary!");
+		return NULL;
+	}
 
 	if (m == NULL || !PyModule_Check(m)) {
 		PyErr_SetString(PyExc_TypeError,


More information about the Python-checkins mailing list