mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
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.
This commit is contained in:
parent
5d9c7ed55a
commit
f76457e122
3 changed files with 6 additions and 2 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue