]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #26844: Fix imp.find_module() to have the exception related to
authorBrett Cannon <brett@python.org>
Fri, 15 Jul 2016 17:58:54 +0000 (10:58 -0700)
committerBrett Cannon <brett@python.org>
Fri, 15 Jul 2016 17:58:54 +0000 (10:58 -0700)
type issues be about 'path' instead of 'name'.

Thanks to Lev Maximov for the patch.

Lib/imp.py
Misc/ACKS
Misc/NEWS

index f6fff442013ae1d719f28bc1eaa91b337788c6cc..e2643918421714b2d979d42a59c890b415e02dab 100644 (file)
@@ -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):
index 27bd691310407bf668505ccd1b06a5612b1b7df9..897b103723107a3a9d0f5099f2fcd49d57e966f5 100644 (file)
--- 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
index f10544c381cce4c4e459c7797f3098c7d0fff86c..6911d1f6ac5132342603ffa52e798709404d4d25 100644 (file)
--- 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.