From 5bbd16c92a2b25574a21b7482c08b6f8d962bd64 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 28 Apr 2017 22:59:24 +0200 Subject: [PATCH] Fix qWebKitVersion issues --- qutebrowser/utils/qtutils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qutebrowser/utils/qtutils.py b/qutebrowser/utils/qtutils.py index 72092cfee..9bd606f02 100644 --- a/qutebrowser/utils/qtutils.py +++ b/qutebrowser/utils/qtutils.py @@ -38,8 +38,8 @@ from PyQt5.QtCore import (qVersion, QEventLoop, QDataStream, QByteArray, from PyQt5.QtWidgets import QApplication try: from PyQt5.QtWebKit import qWebKitVersion -except ImportError: - pass +except ImportError: # pragma: no cover + qWebKitVersion = None from qutebrowser.utils import log @@ -106,6 +106,7 @@ def version_check(version, exact=False, strict=False): def is_qtwebkit_ng(): """Check if the given version is QtWebKit-NG.""" + assert qWebKitVersion is not None return (pkg_resources.parse_version(qWebKitVersion()) > pkg_resources.parse_version('538.1'))