]> granicus.if.org Git - python/commit
Issue #18018: Raise an ImportError if a relative import is attempted
authorBrett Cannon <brett@python.org>
Sat, 23 Jan 2016 00:39:02 +0000 (16:39 -0800)
committerBrett Cannon <brett@python.org>
Sat, 23 Jan 2016 00:39:02 +0000 (16:39 -0800)
commit9fa812668faf0d2d7839845e1a0da19b87bdbc29
tree80c2c811909e691d6ab1fc2fea7ad9ca1619bdd7
parent4b18dd339a9919e6f5fa3485c8b871ed19d9e391
Issue #18018: Raise an ImportError if a relative import is attempted
with no known parent package.

Previously SystemError was raised if the parent package didn't exist
(e.g., __package__ was set to '').
Thanks to Florent Xicluna and Yongzhi Pan for reporting the issue.
Doc/whatsnew/3.6.rst
Lib/test/test_importlib/import_/test_relative_imports.py
Misc/NEWS
Python/import.c