summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2016-07-15 17:58:54 (GMT)
committerBrett Cannon <brett@python.org>2016-07-15 17:58:54 (GMT)
commitf76457e12203d301c94e33957ff7121a24856b83 (patch)
tree4c536800b7fbda8ba1530b55a4f04f61eea85e6e
parent5d9c7ed55aa824782a6dcd4db355ef2d3d03fb8a (diff)
downloadcpython-f76457e12203d301c94e33957ff7121a24856b83.zip
cpython-f76457e12203d301c94e33957ff7121a24856b83.tar.gz
cpython-f76457e12203d301c94e33957ff7121a24856b83.tar.bz2
Issue #26844: Fix imp.find_module() to have the exception related to
type issues be about 'path' instead of 'name'. Thanks to Lev Maximov for the patch.
-rw-r--r--Lib/imp.py4
-rw-r--r--Misc/ACKS1
-rw-r--r--Misc/NEWS3
3 files changed, 6 insertions, 2 deletions
diff --git a/Lib/imp.py b/Lib/imp.py
index f6fff44..e264391 100644
--- a/Lib/imp.py
+++ b/Lib/imp.py
@@ -266,8 +266,8 @@ def find_module(name, path=None):
raise TypeError("'name' must be a str, not {}".format(type(name)))
elif not isinstance(path, (type(None), list)):
# Backwards-compatibility
- raise RuntimeError("'list' must be None or a list, "
- "not {}".format(type(name)))
+ raise RuntimeError("'path' must be None or a list, "
+ "not {}".format(type(path)))
if path is None:
if is_builtin(name):
diff --git a/Misc/ACKS b/Misc/ACKS
index 27bd691..897b103 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -939,6 +939,7 @@ Graham Matthews
mattip
Martin Matusiak
Dieter Maurer
+Lev Maximov
Daniel May
Madison May
Lucas Maystre
diff --git a/Misc/NEWS b/Misc/NEWS
index f10544c..6911d1f 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -22,6 +22,9 @@ Core and Builtins
Library
-------
+- Issue #26844: Fix error message for imp.find_module() to refer to 'path'
+ instead of 'name'. Patch by Lev Maximov.
+
- Issue #23804: Fix SSL zero-length recv() calls to not block and not raise
an error about unclean EOF.