Display req name on error (#14117)

Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
This commit is contained in:
Emmanuel Ferdman
2025-05-22 01:35:36 +03:00
committed by GitHub
parent 3e26a91f40
commit 7e670d52e4
+1 -1
View File
@@ -169,7 +169,7 @@ def _get_pkgs_associated_with_requirement(req_name: str) -> list[str]:
toplevel_txt_contents = dist.read_text("top_level.txt")
if toplevel_txt_contents is None:
if dist.files is None:
raise RuntimeError("Can't read find the packages associated with requirement {req_name!r}")
raise RuntimeError(f"Can't read find the packages associated with requirement {req_name!r}")
maybe_modules = [f.parts[0] if len(f.parts) > 1 else inspect.getmodulename(f) for f in dist.files]
packages = [name for name in maybe_modules if name is not None and "." not in name]
else: