File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -626,15 +626,19 @@ def _project_relative_path(absolute_path):
626626 Python library installation.
627627 """
628628 from sysconfig import get_path
629- libdir = get_path ("platlib" )
630- for prefix_path in (_git_project_root () or os .getcwd (), libdir ):
629+ paths = filter (None , (
630+ _git_project_root () or os .getcwd (),
631+ get_path ("stdlib" ),
632+ get_path ("platlib" ),
633+ ))
634+ for prefix_path in map (os .path .realpath , paths ):
631635 common_path = os .path .commonpath ([prefix_path , absolute_path ])
632636 if os .path .samefile (common_path , prefix_path ):
633637 # absolute_path is a descendant of prefix_path
634638 return os .path .relpath (absolute_path , prefix_path )
635639 raise RuntimeError (
636640 f"absolute path { absolute_path !r} is not a descendant of the current working directory "
637- "or of the system's python library."
641+ f "or of the system's python library { paths } ."
638642 )
639643
640644
You can’t perform that action at this time.
0 commit comments