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

Skip to content

Commit 1e81528

Browse files
committed
Fix the doc build hanging (based on a report by Sandro Tosi).
1 parent e933ef6 commit 1e81528

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

doc/make.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def html():
138138
options = "-D plot_formats=\"[('png', 80)]\""
139139
else:
140140
options = ''
141-
if os.system('sphinx-build %s -P -b html -d build/doctrees . build/html' % options):
141+
if os.system('sphinx-build %s -b html -d build/doctrees . build/html' % options):
142142
raise SystemExit("Building HTML failed.")
143143

144144
figures_dest_path = 'build/html/pyplots'

lib/matplotlib/sphinxext/plot_directive.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,10 @@ def render_figures(code, code_path, output_dir, output_base, context,
498498
# -- Parse format list
499499
default_dpi = {'png': 80, 'hires.png': 200, 'pdf': 200}
500500
formats = []
501-
for fmt in config.plot_formats:
501+
plot_formats = config.plot_formats
502+
if isinstance(plot_formats, (str, unicode)):
503+
plot_formats = eval(plot_formats)
504+
for fmt in plot_formats:
502505
if isinstance(fmt, str):
503506
formats.append((fmt, default_dpi.get(fmt, 80)))
504507
elif type(fmt) in (tuple, list) and len(fmt)==2:
@@ -584,6 +587,9 @@ def render_figures(code, code_path, output_dir, output_base, context,
584587

585588
results.append((code_piece, images))
586589

590+
if not context:
591+
clear_state(config.plot_rcparams)
592+
587593
return results
588594

589595
def run(arguments, content, options, state_machine, state, lineno):

0 commit comments

Comments
 (0)