Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the documentation and the error message of modpath_from_file #2532

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions astroid/modutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,9 @@ def modpath_from_file_with_callback(
return modpath

raise ImportError(
"Unable to find module for {} in {}".format(filename, ", \n".join(sys.path))
"Unable to find module for {} in {}".format(
filename, ", \n".join(paths_to_check)
)
)


Expand All @@ -305,8 +307,8 @@ def modpath_from_file(filename: str, path: Sequence[str] | None = None) -> list[
:param filename: file's path for which we want the module's name

:type Optional[List[str]] path:
Optional list of path where the module or package should be
searched (use sys.path if nothing or None is given)
Optional list of paths where the module or package should be
searched, additionally to sys.path

:raise ImportError:
if the corresponding module's name has not been found
Expand Down
Loading