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

Skip to content

Commit f725924

Browse files
authored
Merge pull request #15956 from meeseeksmachine/auto-backport-of-pr-15901-on-v3.2.x
Backport PR #15901 on branch v3.2.x (Update backend_nbagg for removal of Gcf._activeQue.)
2 parents 95de4dd + 0965958 commit f725924

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/matplotlib/backends/backend_nbagg.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def connection_info():
4040
for manager in Gcf.get_all_fig_managers()
4141
]
4242
if not is_interactive():
43-
result.append('Figures pending show: {}'.format(len(Gcf._activeQue)))
43+
result.append(f'Figures pending show: {len(Gcf.figs)}')
4444
return '\n'.join(result)
4545

4646

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

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

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

0 commit comments

Comments
 (0)