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

Appearance settings

Commit 5eb7b21

Browse filesBrowse files
committed
Swallow RuntimeError in __del__.
This likely indicates that the underlying C++ object has been deleted and therefore the clean-up code is unnecessary.
1 parent 28514ca commit 5eb7b21
Copy full SHA for 5eb7b21

File tree

Expand file treeCollapse file tree

1 file changed

+7
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-3
lines changed

‎lib/matplotlib/backends/backend_qt4.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_qt4.py
+7-3Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,13 @@ def __init__(self, *args, **kwargs):
102102

103103
def __del__(self):
104104
# Probably not necessary in practice, but is good behavior to disconnect
105-
TimerBase.__del__(self)
106-
QtCore.QObject.disconnect(self._timer , QtCore.SIGNAL('timeout()'),
107-
self._on_timer)
105+
try:
106+
TimerBase.__del__(self)
107+
QtCore.QObject.disconnect(self._timer,
108+
QtCore.SIGNAL('timeout()'), self._on_timer)
109+
except RuntimeError:
110+
# Timer C++ object already deleted
111+
pass
108112

109113
def _timer_set_single_shot(self):
110114
self._timer.setSingleShot(self._single)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.