8000 Merge pull request #14027 from meeseeksmachine/auto-backport-of-pr-14… · matplotlib/matplotlib@89bb235 · GitHub
[go: up one dir, main page]

Skip to content

Commit 89bb235

Browse files
dstansbydstansbyauthored
Merge pull request #14027 from meeseeksmachine/auto-backport-of-pr-14026-on-v3.1.x
Backport PR #14026 on branch v3.1.x (Fix bug in plot_directive that caused links to plots in different formats to be missing)
2 parents b7c853b + c7c215f commit 89bb235

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/matplotlib/sphinxext/plot_directive.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -566,10 +566,14 @@ def render_figures(code, code_path, output_dir, output_base, context,
566566
# Look for 9267 single-figure output files first
567567
all_exists = True
568568
img = ImageFile(output_base, output_dir)
569-
if not any(out_of_date(code_path, img.filename(fmt))
570-
for fmt, dpi in formats):
569+
for format, dpi in formats:
570+
if out_of_date(code_path, img.filename(format)):
571+
all_exists = False
572+
break
573+
img.formats.append(format)
574+
575+
if all_exists:
571576
return [(code, [img])]
572-
img.formats.extend(fmt for fmt, dpi in formats)
573577

574578
# Then look for multi-figure output files
575579
results = []

0 commit comments

Comments
 (0)
0