Skip to content

Commit 1411ba3

Browse files
tacaswellQuLogic
andcommitted
Be more careful about iding plt.show
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
1 parent 23b5ee2 commit 1411ba3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/sphinxext/plot_directive.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,8 @@ def _split_code_at_show(text, function_name):
313313
parts = []
314314
part = []
315315
for line in text.split("\n"):
316-
if (not is_doctest and line.startswith('plt.show')) or \
317-
(is_doctest and line.strip() == '>>> plt.show()'):
316+
if ((not is_doctest and line.startswith('plt.show(')) or
317+
(is_doctest and line.strip() == '>>> plt.show()')):
318318
part.append(line)
319319
parts.append("\n".join(part))
320320
part = []

0 commit comments

Comments
 (0)