Fix qWebKitVersion issues

This commit is contained in:
Florian Bruhin 2017-04-28 22:59:24 +02:00
parent bffdea6719
commit 5bbd16c92a

View File

@ -38,8 +38,8 @@ from PyQt5.QtCore import (qVersion, QEventLoop, QDataStream, QByteArray,
from PyQt5.QtWidgets import QApplication from PyQt5.QtWidgets import QApplication
try: try:
from PyQt5.QtWebKit import qWebKitVersion from PyQt5.QtWebKit import qWebKitVersion
except ImportError: except ImportError: # pragma: no cover
pass qWebKitVersion = None
from qutebrowser.utils import log from qutebrowser.utils import log
@ -106,6 +106,7 @@ def version_check(version, exact=False, strict=False):
def is_qtwebkit_ng(): def is_qtwebkit_ng():
"""Check if the given version is QtWebKit-NG.""" """Check if the given version is QtWebKit-NG."""
assert qWebKitVersion is not None
return (pkg_resources.parse_version(qWebKitVersion()) > return (pkg_resources.parse_version(qWebKitVersion()) >
pkg_resources.parse_version('538.1')) pkg_resources.parse_version('538.1'))