Remove unnecessary exception handling
This is superseded by the new deleteLater function.
@@ -21,13 +21,7 @@ class CallTipWidget(QtWidgets.QLabel):
assert isinstance(text_edit, (QtWidgets.QTextEdit, QtWidgets.QPlainTextEdit))
super().__init__(None, QtCore.Qt.ToolTip)
- # This necessary to avoid an error when the widget was already
- # deleted.
- # Fixes jupyter/qtconsole#507
- try:
- text_edit.destroyed.connect(lambda: self.deleteLater())
- except RuntimeError:
- pass
+ text_edit.destroyed.connect(self.deleteLater)
self._hide_timer = QtCore.QBasicTimer()
self._text_edit = text_edit
