From 8539d092df29740b30154211016bd64e8d1488ba Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 12 Oct 2017 19:41:49 +0200 Subject: [PATCH] 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. --- qutebrowser/misc/earlyinit.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/qutebrowser/misc/earlyinit.py b/qutebrowser/misc/earlyinit.py index a10f55e88..84969a17d 100644 --- a/qutebrowser/misc/earlyinit.py +++ b/qutebrowser/misc/earlyinit.py @@ -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))