From f76457e12203d301c94e33957ff7121a24856b83 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Fri, 15 Jul 2016 10:58:54 -0700 Subject: 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. --- Lib/imp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Lib/imp.py') diff --git a/Lib/imp.py b/Lib/imp.py index f6fff44201..e264391842 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): -- cgit v1.2.1