mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
#14798: pyclbr now raises ImportError instead of KeyError for missing packages
This commit is contained in:
parent
1033b310a3
commit
8d88604682
4 changed files with 12 additions and 0 deletions
|
|
@ -167,6 +167,11 @@ class PyclbrTest(TestCase):
|
|||
cm('email.parser')
|
||||
cm('test.test_pyclbr')
|
||||
|
||||
def test_issue_14798(self):
|
||||
# test ImportError is raised when the first part of a dotted name is
|
||||
# not a package
|
||||
self.assertRaises(ImportError, pyclbr.readmodule_ex, 'asyncore.foo')
|
||||
|
||||
|
||||
def test_main():
|
||||
run_unittest(PyclbrTest)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue