Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcf7618c

Browse files
committed
Merge pull request#1098 from efiring/suppress_closing_exception
suppress exception upon quitting with qt4agg on osx
2 parents9aab0be +9520d9f commitcf7618c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

‎lib/matplotlib/backend_bases.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,11 +1599,13 @@ def close_event(self, guiEvent=None):
15991599
try:
16001600
event=CloseEvent(s,self,guiEvent=guiEvent)
16011601
self.callbacks.process(s,event)
1602-
exceptTypeError:
1602+
except(TypeError,AttributeError):
16031603
pass
16041604
# Suppress the TypeError when the python session is being killed.
16051605
# It may be that a better solution would be a mechanism to
16061606
# disconnect all callbacks upon shutdown.
1607+
# AttributeError occurs on OSX with qt4agg upon exiting
1608+
# with an open window; 'callbacks' attribute no longer exists.
16071609

16081610
defkey_press_event(self,key,guiEvent=None):
16091611
"""
@@ -2423,12 +2425,12 @@ def __init__(self, canvas, num):
24232425
self.key_press)
24242426
"""
24252427
The returned id from connecting the default key handler via :meth:`FigureCanvasBase.mpl_connnect`.
2426-
2428+
24272429
To disable default key press handling::
2428-
2430+
24292431
manager, canvas = figure.canvas.manager, figure.canvas
24302432
canvas.mpl_disconnect(manager.key_press_handler_id)
2431-
2433+
24322434
"""
24332435

24342436
defdestroy(self):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp