Fix version checking in earlyinit

With the previous commit, we also checked that PyQt was >= 5.7.1, but we want to
support PyQt 5.7.0. Instead, we now check the individual components by hand.

Also, the previous check accidentally allowed PyQt >= 5.2.0 instead of 5.7.0.
This commit is contained in:
Florian Bruhin 2017-10-12 19:41:49 +02:00
parent dfe2f9e38c
commit 8539d092df

View File

@ -168,9 +168,11 @@ def qt_version(qversion=None, qt_version_str=None):
def check_qt_version():
"""Check if the Qt version is recent enough."""
from PyQt5.QtCore import PYQT_VERSION, PYQT_VERSION_STR
from qutebrowser.utils import qtutils
if not qtutils.version_check('5.7.1') or PYQT_VERSION < 0x050200:
from PyQt5.QtCore import (qVersion, QT_VERSION, PYQT_VERSION,
PYQT_VERSION_STR)
from pkg_resources import parse_version
if (QT_VERSION < 0x050710 or PYQT_VERSION < 0x050700 or
parse_version(qVersion()) < parse_version('5.7.1')):
text = ("Fatal error: Qt >= 5.7.1 and PyQt >= 5.7 are required, "
"but Qt {} / PyQt {} is installed.".format(qt_version(),
PYQT_VERSION_STR))