Trying to import a submodule from another module and not a package was raising
AttributeError in importlib when it should be an ImportError.

Found when running importlib against test_runpy.
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py
index bd62c36..466b287 100644
--- a/Lib/importlib/_bootstrap.py
+++ b/Lib/importlib/_bootstrap.py
@@ -879,7 +879,11 @@
                 _gcd_import(parent)
             # Backwards-compatibility; be nicer to skip the dict lookup.
             parent_module = sys.modules[parent]
-            path = parent_module.__path__
+            try:
+                path = parent_module.__path__
+            except AttributeError:
+                raise ImportError("no module named {}; "
+                                    "{} is not a package".format(name, parent))
         meta_path = sys.meta_path + _IMPLICIT_META_PATH
         for finder in meta_path:
             loader = finder.find_module(name, path)
diff --git a/Lib/importlib/test/import_/test_packages.py b/Lib/importlib/test/import_/test_packages.py
index 1a15ebb..faadc32 100644
--- a/Lib/importlib/test/import_/test_packages.py
+++ b/Lib/importlib/test/import_/test_packages.py
@@ -21,6 +21,12 @@
                 with self.assertRaises(ImportError):
                     import_util.import_('pkg.module')
 
+    def test_module_not_package(self):
+        # Try to import a submodule from a non-package should raise ImportError.
+        assert not hasattr(sys, '__path__')
+        with self.assertRaises(ImportError):
+            import_util.import_('sys.no_submodules_here')
+
 
 def test_main():
     from test.support import run_unittest
diff --git a/Lib/importlib/test/regrtest.py b/Lib/importlib/test/regrtest.py
index ca27489..f9721c0 100644
--- a/Lib/importlib/test/regrtest.py
+++ b/Lib/importlib/test/regrtest.py
@@ -8,9 +8,6 @@
 XXX FAILING
     test_import  # execution bit, exception name differing, file name differing
                     between code and module (?)
-    test_runpy  # Importing sys.imp.eric raises AttributeError instead of
-                    ImportError (as does any attempt to import a sub-module
-                    from a non-package, e.g. tokenize.menotreal)
 
 """
 import importlib