8000 prepare a fresh git checkout for doc build on MS windows · jbmohler/matplotlib@d6fe8c9 · GitHub
[go: up one dir, main page]

Skip to content

Commit d6fe8c9

Browse files
committed
prepare a fresh git checkout for doc build on MS windows
1 parent 223f20c commit d6fe8c9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

doc/make.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,16 @@ def all():
250250
]
251251

252252
for link, target in required_symlinks:
253+
if os.path.isfile(link):
254+
# This is special processing that applies on platforms that don't deal
255+
# with git symlinks -- probably only MS windows.
256+
delete = False
257+
with open(link, 'r') as content:
258+
delete = target == content.read()
259+
if delete:
260+
os.unlink(link)
261+
else:
262+
raise RuntimeError("doc/{} should be a directory or symlink -- it isn't")
253263
if not os.path.exists(link):
254264
if hasattr(os, 'symlink'):
255265
os.symlink(target, link)

0 commit comments

Comments
 (0)
0