Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 755740e

Browse files
committed
MNT: support building the docs on windows again
1 parent f48ad73 commit 755740e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

doc/sphinxext/missing_references.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ def get_location(node, app):
9797
(path, line) = get_source_line(node)
9898

9999
if path:
100-
100+
# sometimes the 'path' can contain ':' which are forbidden on
101+
# windows, but on posix just passes through.
102+
path, *post = path.partition(':')
103+
post = ''.join(post)
101104
# We locate references relative to the parent of the doc
102105
# directory, which for matplotlib, will be the root of the
103106
# matplotlib repo. When matplotlib is not an editable install
@@ -122,11 +125,11 @@ def get_location(node, app):
122125

123126
else:
124127
path = "<unknown>"
125-
128+
post = ''
126129
if not line:
127130
line = ""
128131

129-
return f"{path}:{line}"
132+
return f"{path}{post}:{line}"
130133

131134

132135
def _truncate_location(location):

0 commit comments

Comments
 (0)