[Python-checkins] r53385 - python/branches/bcannon-objcap/Python/pythonrun.c

brett.cannon python-checkins at python.org
Thu Jan 11 21:46:44 CET 2007


Author: brett.cannon
Date: Thu Jan 11 21:46:44 2007
New Revision: 53385

Modified:
   python/branches/bcannon-objcap/Python/pythonrun.c
Log:
Store away import function in the 'sys' module.  Will end up implementing a
delegate for the built-in __import__ that calls what is stored there.


Modified: python/branches/bcannon-objcap/Python/pythonrun.c
==============================================================================
--- python/branches/bcannon-objcap/Python/pythonrun.c	(original)
+++ python/branches/bcannon-objcap/Python/pythonrun.c	Thu Jan 11 21:46:44 2007
@@ -246,6 +246,11 @@
 	if (!warnings_module)
 		PyErr_Clear();
 
+	/* Store import machinery somewhere so that a reference is held as
+	   needed. */
+	PyDict_SetItemString(interp->sysdict, "import_",
+			PyDict_GetItemString(interp->builtins, "__import__"));
+
 #if defined(Py_USING_UNICODE) && defined(HAVE_LANGINFO_H) && defined(CODESET)
 	/* On Unix, set the file system encoding according to the
 	   user's preference, if the CODESET names a well-known


More information about the Python-checkins mailing list