Skip to content

Commit bf584bd

Browse files
authored
Merge pull request #15901 from anntzer/nbactive
Update backend_nbagg for removal of Gcf._activeQue.
2 parents bebd7f1 + 2692cf8 commit bf584bd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/matplotlib/backends/backend_nbagg.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def connection_info():
3939
for manager in Gcf.get_all_fig_managers()
4040
]
4141
if not is_interactive():
42-
result.append('Figures pending show: {}'.format(len(Gcf._activeQue)))
42+
result.append(f'Figures pending show: {len(Gcf.figs)}')
4343
return '\n'.join(result)
4444

4545

@@ -259,12 +259,12 @@ def show(*args, block=None, **kwargs):
259259
for manager in managers:
260260
manager.show()
261261

262-
# plt.figure adds an event which puts the figure in focus
263-
# in the activeQue. Disable this behaviour, as it results in
262+
# plt.figure adds an event which makes the figure in focus the
263+
# active one. Disable this behaviour, as it results in
264264
# figures being put as the active figure after they have been
265265
# shown, even in non-interactive mode.
266266
if hasattr(manager, '_cidgcf'):
267267
manager.canvas.mpl_disconnect(manager._cidgcf)
268268

269-
if not interactive and manager in Gcf._activeQue:
270-
Gcf._activeQue.remove(manager)
269+
if not interactive:
270+
Gcf.figs.pop(manager.num, None)

0 commit comments

Comments
 (0)