diff --git a/qutebrowser/utils/log.py b/qutebrowser/utils/log.py index c88df8a38..044b75b65 100644 --- a/qutebrowser/utils/log.py +++ b/qutebrowser/utils/log.py @@ -148,7 +148,11 @@ console_filter = None def stub(suffix=''): """Show a STUB: message for the calling function.""" - function = inspect.stack()[1][3] + try: + function = inspect.stack()[1][3] + except IndexError: # pragma: no cover + misc.exception("Failed to get stack") + function = '' text = "STUB: {}".format(function) if suffix: text = '{} ({})'.format(text, suffix)