summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2010-08-16 22:40:45 (GMT)
committerFlorent Xicluna <florent.xicluna@gmail.com>2010-08-16 22:40:45 (GMT)
commit2760a66b69ab942888b5c0fd3133b67c9b08c2f6 (patch)
tree92ab13699f0cacd044987ad44914e35970ca7f07 /Python
parent102594f7ff7794e9e4d9619447e252f188241ff0 (diff)
downloadcpython-2760a66b69ab942888b5c0fd3133b67c9b08c2f6.zip
cpython-2760a66b69ab942888b5c0fd3133b67c9b08c2f6.tar.gz
cpython-2760a66b69ab942888b5c0fd3133b67c9b08c2f6.tar.bz2
Merged revisions 81214,82302,82465,83090-83091,84097,84099 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r81214 | brett.cannon | 2010-05-16 00:20:16 +0200 (dim., 16 mai 2010) | 2 lines A test was not guaranteeing cleanup in the face of an exception. ................ r82302 | benjamin.peterson | 2010-06-28 00:37:28 +0200 (lun., 28 juin 2010) | 15 lines Merged revisions 81380 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r81380 | brett.cannon | 2010-05-20 13:37:55 -0500 (Thu, 20 May 2010) | 8 lines Turned out that if you used explicit relative import syntax (e.g. from .os import sep) and it failed, import would still try the implicit relative import semantics of an absolute import (from os import sep). That's not right, so when level is negative, only do explicit relative import semantics. Fixes issue #7902. Thanks to Meador Inge for the patch. ........ ................ r82465 | brett.cannon | 2010-07-03 03:32:48 +0200 (sam., 03 juil. 2010) | 3 lines Make test_import a little bit more robust for cleaning up after itself in the face of a failure. ................ r83090 | brett.cannon | 2010-07-23 16:03:16 +0200 (ven., 23 juil. 2010) | 4 lines Explicitly test relative imports by reusing importlib tests. Closes issue 8392. Thanks Virgil Dupras for the initial patch. ................ r83091 | brett.cannon | 2010-07-23 16:45:19 +0200 (ven., 23 juil. 2010) | 1 line Stop shadowing a test class. ................ r84097 | florent.xicluna | 2010-08-16 20:41:19 +0200 (lun., 16 août 2010) | 1 line Use test.support and unittest features. Fix duplicated test (bad merge in r79033). Fix comment for issue #7902. ................ r84099 | florent.xicluna | 2010-08-16 21:03:05 +0200 (lun., 16 août 2010) | 1 line I get it wrong in r84097: s/relative/absolute/ ................
Diffstat (limited to 'Python')
-rw-r--r--Python/import.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/import.c b/Python/import.c
index 87e85a0..5d80983 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -2143,7 +2143,8 @@ import_module_level(char *name, PyObject *globals, PyObject *locals,
if (parent == NULL)
return NULL;
- head = load_next(parent, Py_None, &name, buf, &buflen);
+ head = load_next(parent, level < 0 ? Py_None : parent, &name, buf,
+ &buflen);
if (head == NULL)
return NULL;