Fix earlyinit.qt_version issues
This commit is contained in:
parent
9b5227b987
commit
df6c4c6e73
@ -253,17 +253,17 @@ def get_backend(args):
|
|||||||
return 'webengine'
|
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."""
|
"""Get a Qt version string based on the runtime/compiled versions."""
|
||||||
if qversion is None:
|
if qversion is None:
|
||||||
from PyQt5.QtCore import qVersion
|
from PyQt5.QtCore import qVersion
|
||||||
qversion = qVersion()
|
qversion = qVersion()
|
||||||
if qt_version is None:
|
if qt_version_str is None:
|
||||||
from PyQt5.QtCore import QT_VERSION_STR
|
from PyQt5.QtCore import QT_VERSION_STR
|
||||||
qt_version = QT_VERSION_STR
|
qt_version_str = QT_VERSION_STR
|
||||||
|
|
||||||
if qversion != qt_version:
|
if qversion != qt_version_str:
|
||||||
return '{} (compiled {})'.format(qversion, qt_version)
|
return '{} (compiled {})'.format(qversion, qt_version_str)
|
||||||
else:
|
else:
|
||||||
return qversion
|
return qversion
|
||||||
|
|
||||||
|
@ -29,8 +29,7 @@ import importlib
|
|||||||
import collections
|
import collections
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
|
|
||||||
from PyQt5.QtCore import (QT_VERSION_STR, PYQT_VERSION_STR, qVersion,
|
from PyQt5.QtCore import PYQT_VERSION_STR, QLibraryInfo
|
||||||
QLibraryInfo)
|
|
||||||
from PyQt5.QtNetwork import QSslSocket
|
from PyQt5.QtNetwork import QSslSocket
|
||||||
from PyQt5.QtWidgets import QApplication
|
from PyQt5.QtWidgets import QApplication
|
||||||
|
|
||||||
|
@ -118,7 +118,8 @@ def test_qt_version(same):
|
|||||||
else:
|
else:
|
||||||
qt_version_str = '5.3.0'
|
qt_version_str = '5.3.0'
|
||||||
expected = '5.4.0 (compiled 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
|
assert actual == expected
|
||||||
|
|
||||||
|
|
||||||
|
@ -823,8 +823,7 @@ def test_version_output(git_commit, frozen, style, with_webkit,
|
|||||||
'platform.python_implementation': lambda: 'PYTHON IMPLEMENTATION',
|
'platform.python_implementation': lambda: 'PYTHON IMPLEMENTATION',
|
||||||
'platform.python_version': lambda: 'PYTHON VERSION',
|
'platform.python_version': lambda: 'PYTHON VERSION',
|
||||||
'PYQT_VERSION_STR': 'PYQT VERSION',
|
'PYQT_VERSION_STR': 'PYQT VERSION',
|
||||||
'QT_VERSION_STR': 'QT VERSION',
|
'earlyinit.qt_version': lambda: 'QT VERSION',
|
||||||
'qVersion': lambda: 'QT VERSION',
|
|
||||||
'_module_versions': lambda: ['MODULE VERSION 1', 'MODULE VERSION 2'],
|
'_module_versions': lambda: ['MODULE VERSION 1', 'MODULE VERSION 2'],
|
||||||
'_pdfjs_version': lambda: 'PDFJS VERSION',
|
'_pdfjs_version': lambda: 'PDFJS VERSION',
|
||||||
'QSslSocket': FakeQSslSocket('SSL VERSION'),
|
'QSslSocket': FakeQSslSocket('SSL VERSION'),
|
||||||
|
Loading…
Reference in New Issue
Block a user