From 4bb048cb6a845ce8c396171db0098942f4e2fa23 Mon Sep 17 00:00:00 2001 From: Jay Kamat Date: Wed, 9 May 2018 21:41:59 -0700 Subject: [PATCH] Fix mocked tests --- qutebrowser/mainwindow/tabwidget.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/qutebrowser/mainwindow/tabwidget.py b/qutebrowser/mainwindow/tabwidget.py index c9f65c5a6..7135d587c 100644 --- a/qutebrowser/mainwindow/tabwidget.py +++ b/qutebrowser/mainwindow/tabwidget.py @@ -33,6 +33,7 @@ from PyQt5.QtGui import QIcon, QPalette, QColor from qutebrowser.utils import qtutils, objreg, utils, usertypes, log from qutebrowser.config import config from qutebrowser.misc import objects +from qutebrowser.browser import browsertab PixelMetrics = enum.IntEnum('PixelMetrics', ['icon_padding'], @@ -172,8 +173,12 @@ class TabWidget(QTabWidget): fields['perc_raw'] = tab.progress() fields['backend'] = objects.backend.name fields['private'] = ' [Private Mode] ' if tab.private else '' - fields['audio'] = '[M] ' if tab.is_muted() else ( - '[A] ' if tab.is_recently_audible() else '') + try: + fields['audio'] = '[M] ' if tab.is_muted() else ( + '[A] ' if tab.is_recently_audible() else '') + except (NotImplementedError, browsertab.WebTabError): + # one of the functions was not implemented or had an error, abort + fields['audio'] = '' if tab.load_status() == usertypes.LoadStatus.loading: fields['perc'] = '[{}%] '.format(tab.progress())