diff --git a/qutebrowser/misc/earlyinit.py b/qutebrowser/misc/earlyinit.py index 728a43650..9391288de 100644 --- a/qutebrowser/misc/earlyinit.py +++ b/qutebrowser/misc/earlyinit.py @@ -253,17 +253,17 @@ def get_backend(args): return 'webengine' -def qt_version(qversion=None, qt_version=None): +def qt_version(qversion=None, qt_version_str=None): """Get a Qt version string based on the runtime/compiled versions.""" if qversion is None: from PyQt5.QtCore import qVersion qversion = qVersion() - if qt_version is None: + if qt_version_str is None: from PyQt5.QtCore import QT_VERSION_STR - qt_version = QT_VERSION_STR + qt_version_str = QT_VERSION_STR - if qversion != qt_version: - return '{} (compiled {})'.format(qversion, qt_version) + if qversion != qt_version_str: + return '{} (compiled {})'.format(qversion, qt_version_str) else: return qversion diff --git a/qutebrowser/utils/version.py b/qutebrowser/utils/version.py index 7d72fa5f2..af945ca83 100644 --- a/qutebrowser/utils/version.py +++ b/qutebrowser/utils/version.py @@ -29,8 +29,7 @@ import importlib import collections import pkg_resources -from PyQt5.QtCore import (QT_VERSION_STR, PYQT_VERSION_STR, qVersion, - QLibraryInfo) +from PyQt5.QtCore import PYQT_VERSION_STR, QLibraryInfo from PyQt5.QtNetwork import QSslSocket from PyQt5.QtWidgets import QApplication diff --git a/tests/unit/misc/test_earlyinit.py b/tests/unit/misc/test_earlyinit.py index b26bf7d5e..cf67690fd 100644 --- a/tests/unit/misc/test_earlyinit.py +++ b/tests/unit/misc/test_earlyinit.py @@ -118,7 +118,8 @@ def test_qt_version(same): else: qt_version_str = '5.3.0' expected = '5.4.0 (compiled 5.3.0)' - actual = earlyinit.qt_version(qversion='5.4.0', qt_version=qt_version_str) + actual = earlyinit.qt_version(qversion='5.4.0', + qt_version_str=qt_version_str) assert actual == expected diff --git a/tests/unit/utils/test_version.py b/tests/unit/utils/test_version.py index 46185f5d1..20863d0b2 100644 --- a/tests/unit/utils/test_version.py +++ b/tests/unit/utils/test_version.py @@ -823,8 +823,7 @@ def test_version_output(git_commit, frozen, style, with_webkit, 'platform.python_implementation': lambda: 'PYTHON IMPLEMENTATION', 'platform.python_version': lambda: 'PYTHON VERSION', 'PYQT_VERSION_STR': 'PYQT VERSION', - 'QT_VERSION_STR': 'QT VERSION', - 'qVersion': lambda: 'QT VERSION', + 'earlyinit.qt_version': lambda: 'QT VERSION', '_module_versions': lambda: ['MODULE VERSION 1', 'MODULE VERSION 2'], '_pdfjs_version': lambda: 'PDFJS VERSION', 'QSslSocket': FakeQSslSocket('SSL VERSION'),