#14798: pyclbr now raises ImportError instead of KeyError for missing packages
diff --git a/Lib/test/test_pyclbr.py b/Lib/test/test_pyclbr.py
index 6aa96d5..7bdc555 100644
--- a/Lib/test/test_pyclbr.py
+++ b/Lib/test/test_pyclbr.py
@@ -188,6 +188,11 @@
         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)