summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <git@the-compiler.org>2017-10-12 19:41:49 +0200
committerFlorian Bruhin <git@the-compiler.org>2017-10-12 19:41:49 +0200
commit8539d092df29740b30154211016bd64e8d1488ba (patch)
tree431e67ca5fa53a5351ed27821ca360521a489b88
parentdfe2f9e38c342ae9e36c85e8c8b4dc3c595c2a1d (diff)
downloadqutebrowser-8539d092df29740b30154211016bd64e8d1488ba.tar.gz
qutebrowser-8539d092df29740b30154211016bd64e8d1488ba.zip
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.
-rw-r--r--qutebrowser/misc/earlyinit.py8
1 files 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))