File tree 1 file changed +10
-3
lines changed
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 7
7
import sys
8
8
import re
9
9
import argparse
10
+ import matplotlib
10
11
11
12
def copy_if_out_of_date (original , derived ):
12
13
if (not os .path .exists (derived ) or
@@ -38,7 +39,13 @@ def linkcheck():
38
39
39
40
def html (buildername = 'html' ):
40
41
check_build ()
41
- copy_if_out_of_date ('../lib/matplotlib/mpl-data/matplotlibrc' , '_static/matplotlibrc' )
42
+
43
+ rc = '../lib/matplotlib/mpl-data/matplotlibrc'
44
+ default_rc = os .path .join (matplotlib ._get_data_path (), 'matplotlibrc' )
45
+ if not os .path .exists (rc ) and os .path .exists (default_rc ):
46
+ rc = default_rc
47
+ copy_if_out_of_date (rc , '_static/matplotlibrc' )
48
+
42
49
if small_docs :
43
50
options = "-D plot_formats=png:80"
44
51
else :
@@ -168,9 +175,9 @@ def all():
168
175
raise RuntimeError ("doc/{0} should be a directory or symlink -- it"
169
176
" isn't" .format (link ))
170
177
if not os .path .exists (link ):
171
- if hasattr ( os , 'symlink' ) :
178
+ try :
172
179
os .symlink (target , link )
173
- else :
180
+ except OSError :
174
181
symlink_warnings .append ('files copied to {0}' .format (link ))
175
182
shutil .copytree (os .path .join (link , '..' , target ), link )
176
183
You can’t perform that action at this time.
0 commit comments