From 8c3f05e9f0f0b30a3d4a2433e92471794d8258af Mon Sep 17 00:00:00 2001 From: Milan Oberkirch Date: Thu, 15 Jun 2017 07:34:50 +1000 Subject: bpo-30436: Raise ModuleNotFoundError for importlib.util.find_spec() when parent isn't a package (GH-1899) Previously AttributeError was raised, but that's not very reflective of the fact that the requested module can't be found since the specified parent isn't actually a package. --- Lib/test/test_cmd_line_script.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Lib/test/test_cmd_line_script.py') diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py index 1587daf8f5..0d0bcd784d 100644 --- a/Lib/test/test_cmd_line_script.py +++ b/Lib/test/test_cmd_line_script.py @@ -427,7 +427,7 @@ class CmdLineTest(unittest.TestCase): tests = ( ('builtins', br'No code object available'), ('builtins.x', br'Error while finding module specification.*' - br'AttributeError'), + br'ModuleNotFoundError'), ('builtins.x.y', br'Error while finding module specification.*' br'ModuleNotFoundError.*No module named.*not a package'), ('os.path', br'loader.*cannot handle'), -- cgit v1.2.1