mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-30876: Relative import from unloaded package now reimports the package (#2639)
instead of failing with SystemError. Relative import from non-package now fails with ImportError rather than SystemError.
This commit is contained in:
parent
6d13b22e3a
commit
8a9cd20edc
8 changed files with 390 additions and 388 deletions
|
@ -81,7 +81,7 @@ class Using__package__:
|
|||
|
||||
def test_bad__package__(self):
|
||||
globals = {'__package__': '<not real>'}
|
||||
with self.assertRaises(SystemError):
|
||||
with self.assertRaises(ModuleNotFoundError):
|
||||
self.__import__('', globals, {}, ['relimport'], 1)
|
||||
|
||||
def test_bunk__package__(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue