From c201c8b59c3606f7dcb47f4ce5aa7b6780ab2a29 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Thu, 30 Mar 2023 04:31:08 -0400 Subject: [PATCH] Fix return type of get_plot_commands The typing PR found that this was returning a generator [1], but this was an error from #24000, as 3.6 and earlier returned a list. [1] https://github.com/matplotlib/matplotlib/pull/24976#discussion_r1152872718 --- lib/matplotlib/pyplot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index f1e2918080c9..3a3f919d1686 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -2066,8 +2066,8 @@ def get_plot_commands(): NON_PLOT_COMMANDS = { 'connect', 'disconnect', 'get_current_fig_manager', 'ginput', 'new_figure_manager', 'waitforbuttonpress'} - return (name for name in _get_pyplot_commands() - if name not in NON_PLOT_COMMANDS) + return [name for name in _get_pyplot_commands() + if name not in NON_PLOT_COMMANDS] def _get_pyplot_commands():