Skip to content
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
DOC: Don't try to link paths that are on a different drive
This may happen if Python is installed on C: and Matplotlib is installed
on some other drive. As the point of this extension is to create GitHub
links for Matplotlib *only*, we should ignore all paths that cannot be
relativized to it.

Fixes #24574
  • Loading branch information
QuLogic committed Dec 3, 2022
commit 8187382f7122a6e826e4b9f756242df561e95464
5 changes: 4 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,10 @@ def linkcode_resolve(domain, info):
if lineno else "")

startdir = Path(matplotlib.__file__).parent.parent
fn = os.path.relpath(fn, start=startdir).replace(os.path.sep, '/')
try:
fn = os.path.relpath(fn, start=startdir).replace(os.path.sep, '/')
except ValueError:
return None

if not fn.startswith(('matplotlib/', 'mpl_toolkits/')):
return None
Expand Down