Skip to content

Commit

Permalink
Merge 7fd7395 into bb18bb7
Browse files Browse the repository at this point in the history
  • Loading branch information
ccordoba12 committed Nov 14, 2021
2 parents bb18bb7 + 7fd7395 commit 67840e1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion qtconsole/call_tip_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ def __init__(self, text_edit):
"""
assert isinstance(text_edit, (QtWidgets.QTextEdit, QtWidgets.QPlainTextEdit))
super().__init__(None, QtCore.Qt.ToolTip)
text_edit.destroyed.connect(lambda: self.deleteLater())

# 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

self._hide_timer = QtCore.QBasicTimer()
self._text_edit = text_edit
Expand Down

0 comments on commit 67840e1

Please sign in to comment.