mirror of
https://github.com/python/cpython.git
synced 2025-08-24 02:35:59 +00:00
Issue #14285: Do not catch exceptions initializing any ancestor package
The previous fix only handled the case of the parent package of __main__ failing to initialize. Also make the "Error while finding spec" formatting slightly more appealing, and document and test that the module name must be absolute.
This commit is contained in:
parent
a29eb08fb9
commit
7dda421bff
5 changed files with 31 additions and 6 deletions
|
@ -433,6 +433,7 @@ class CmdLineTest(unittest.TestCase):
|
|||
('importlib', br'No module named.*'
|
||||
br'is a package and cannot be directly executed'),
|
||||
('importlib.nonexistant', br'No module named'),
|
||||
('.unittest', br'Relative module names not supported'),
|
||||
)
|
||||
for name, regex in tests:
|
||||
with self.subTest(name):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue