summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_cmd_line_script.py
diff options
context:
space:
mode:
authorMilan Oberkirch <zvyn@oberkirch.org>2017-06-14 21:34:50 (GMT)
committerBrett Cannon <brettcannon@users.noreply.github.com>2017-06-14 21:34:50 (GMT)
commit8c3f05e9f0f0b30a3d4a2433e92471794d8258af (patch)
tree57f6ae60b1701bf4ca4be1f9db1afce1e2bea795 /Lib/test/test_cmd_line_script.py
parent32fd874afe55e396e3c9a5af35e7bb3d8e0b8f02 (diff)
downloadcpython-8c3f05e9f0f0b30a3d4a2433e92471794d8258af.zip
cpython-8c3f05e9f0f0b30a3d4a2433e92471794d8258af.tar.gz
cpython-8c3f05e9f0f0b30a3d4a2433e92471794d8258af.tar.bz2
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.
Diffstat (limited to 'Lib/test/test_cmd_line_script.py')
-rw-r--r--Lib/test/test_cmd_line_script.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py
index 1587daf..0d0bcd7 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'),