8000 Update make.py · matplotlib/matplotlib@e2e6496 · GitHub
[go: up one dir, main page]

Skip to content

Commit e2e6496

Browse files
committed
Update make.py
Referencing #6527, these changes provide: - fix for symlink exception on Windows - no need for rebuilding matplotlib from source
1 parent 7f7080b commit e2e6496

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

doc/make.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import sys
88
import re
99
import argparse
10+
import matplotlib
1011

1112
def copy_if_out_of_date(original, derived):
1213
if (not os.path.exists(derived) or
@@ -38,7 +39,13 @@ def linkcheck():
3839

3940
def html(buildername='html'):
4041
check_build()
41-
copy_if_out_of_date('../lib/matplotlib/mpl-data/matplotlibrc', '_static/matplotlibrc')
42+
43+
rc = '../lib/matplotlib/mpl-data/matplotlibrc'
44+
active_rc = matplotlib.matplotlib_fname()
45+
if not os.path.exists(rc) and os.path.exists(active_rc):
46+
rc = active_rc
47+
copy_if_out_of_date(rc, '_static/matplotlibrc')
48+
4249
if small_docs:
4350
options = "-D plot_formats=png:80"
4451
else:
@@ -168,9 +175,9 @@ def all():
168175
raise RuntimeError("doc/{0} should be a directory or symlink -- it"
169176
" isn't".format(link))
170177
if not os.path.exists(link):
171-
if hasattr(os, 'symlink'):
178+
try:
172179
os.symlink(target, link)
173-
else:
180+
except OSError:
174181
symlink_warnings.append('files copied to {0}'.format(link))
175182
shutil.copytree(os.path.join(link, '..', target), link)
176183

0 commit comments

Comments
 (0)
0