Handle RuntimeError in AbstractTab __repr__

Apparently it can happen that we try to get a repr of an already destroyed tab.
In that case, we display <RuntimeError> as the URL now.
This commit is contained in:
Florian Bruhin 2017-10-11 08:02:27 +02:00
parent 2a3369e2fe
commit 59a1609dd8

View File

@ -860,6 +860,6 @@ class AbstractTab(QWidget):
try:
url = utils.elide(self.url().toDisplayString(QUrl.EncodeUnicode),
100)
except AttributeError:
url = '<AttributeError>'
except (AttributeError, RuntimeError) as exc:
url = '<{}>'.format(exc.__class__.__name__)
return utils.get_repr(self, tab_id=self.tab_id, url=url)