diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-03-14 19:54:52 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-03-14 19:54:52 (GMT) |
commit | fe93faf98c0866c20f05dc009a8ac2fecee80692 (patch) | |
tree | 42249c67dc2ec193951ddec2baf21823d50ce756 /Python/bltinmodule.c | |
parent | 98dbba5d209dda5300df549ef26eb4646cb891f0 (diff) | |
download | cpython-fe93faf98c0866c20f05dc009a8ac2fecee80692.zip cpython-fe93faf98c0866c20f05dc009a8ac2fecee80692.tar.gz cpython-fe93faf98c0866c20f05dc009a8ac2fecee80692.tar.bz2 |
Issue #3080: Add PyImport_ImportModuleLevelObject() function
Use it for the builtin __import__ function.
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r-- | Python/bltinmodule.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index ca40cb0..3074e4c 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -155,17 +155,14 @@ builtin___import__(PyObject *self, PyObject *args, PyObject *kwds) { static char *kwlist[] = {"name", "globals", "locals", "fromlist", "level", 0}; - char *name; - PyObject *globals = NULL; - PyObject *locals = NULL; - PyObject *fromlist = NULL; + PyObject *name, *globals = NULL, *locals = NULL, *fromlist = NULL; int level = -1; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|OOOi:__import__", + if (!PyArg_ParseTupleAndKeywords(args, kwds, "U|OOOi:__import__", kwlist, &name, &globals, &locals, &fromlist, &level)) return NULL; - return PyImport_ImportModuleLevel(name, globals, locals, - fromlist, level); + return PyImport_ImportModuleLevelObject(name, globals, locals, + fromlist, level); } PyDoc_STRVAR(import_doc, |