[Python-checkins] CVS: python/dist/src/Python import.c,2.160,2.161
M.-A. Lemburg
lemburg@users.sourceforge.net
Fri, 09 Feb 2001 11:40:17 -0800
- Previous message: [Python-checkins] CVS: python/dist/src/Lib/test test_imgfile.py,1.10,1.11
- Next message: [Python-checkins] CVS: python/dist/src/Lib asynchat.py,1.10,1.11 pickle.py,1.44,1.45 popen2.py,1.18,1.19 posixpath.py,1.40,1.41 pyclbr.py,1.17,1.18 smtpd.py,1.1,1.2 urllib.py,1.115,1.116 webbrowser.py,1.10,1.11
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/python/python/dist/src/Python
In directory usw-pr-cvs1:/tmp/cvs-serv27106
Modified Files:
import.c
Log Message:
This modified version of a patch by Thomas Heller allows __import__
hooks to take over the Python import machinery at a very early stage
in the Python startup phase.
If there are still places in the Python interpreter which need to
bypass the __import__ hook, these places must now use
PyImport_ImportModuleEx() instead. So far no other places than in
the import mechanism itself have been identified.
Index: import.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/import.c,v
retrieving revision 2.160
retrieving revision 2.161
diff -C2 -r2.160 -r2.161
*** import.c 2001/02/02 20:13:24 2.160
--- import.c 2001/02/09 19:40:15 2.161
***************
*** 1459,1469 ****
PyImport_ImportModule(char *name)
{
! static PyObject *fromlist = NULL;
! if (fromlist == NULL && strchr(name, '.') != NULL) {
! fromlist = Py_BuildValue("(s)", "*");
! if (fromlist == NULL)
! return NULL;
! }
! return PyImport_ImportModuleEx(name, NULL, NULL, fromlist);
}
--- 1459,1469 ----
PyImport_ImportModule(char *name)
{
! PyObject *pname;
! PyObject *result;
!
! pname = PyString_FromString(name);
! result = PyImport_Import(pname);
! Py_DECREF(pname);
! return result;
}
***************
*** 1907,1911 ****
if (standard_builtins == NULL) {
standard_builtins =
! PyImport_ImportModule("__builtin__");
if (standard_builtins == NULL)
return NULL;
--- 1907,1912 ----
if (standard_builtins == NULL) {
standard_builtins =
! PyImport_ImportModuleEx("__builtin__",
! NULL, NULL, NULL);
if (standard_builtins == NULL)
return NULL;
- Previous message: [Python-checkins] CVS: python/dist/src/Lib/test test_imgfile.py,1.10,1.11
- Next message: [Python-checkins] CVS: python/dist/src/Lib asynchat.py,1.10,1.11 pickle.py,1.44,1.45 popen2.py,1.18,1.19 posixpath.py,1.40,1.41 pyclbr.py,1.17,1.18 smtpd.py,1.1,1.2 urllib.py,1.115,1.116 webbrowser.py,1.10,1.11
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]