Skip to content

Commit

Permalink
Changed check_pyqt() to work with qtpy (closes Bitmessage#897)
Browse files Browse the repository at this point in the history
  • Loading branch information
g1itch committed Nov 15, 2018
1 parent 798949b commit aaf7e03
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/depends.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import logging
import os
from distutils import version
from importlib import import_module

# We can now use logging so set up a simple configuration
Expand Down Expand Up @@ -385,21 +386,21 @@ def check_pyqt():
Here we are checking for PyQt4 with its version, as for it require
PyQt 4.8 or later.
"""
QtCore = try_import(
'qtpy.QtCore', 'PyBitmessage requires PyQt 4.8 or later and Qt 4.7 or later.')
qtpy = try_import(
'qtpy', 'PyBitmessage requires qtpy, PyQt 4.8 or later and Qt 4.7 or later.')

if not QtCore:
if not qtpy:
return False

logger.info('PyQt Version: %s', QtCore.PYQT_VERSION_STR)
logger.info('Qt Version: %s', QtCore.QT_VERSION_STR)
logger.info('PyQt Version: %s', qtpy.PYQT_VERSION)
logger.info('Qt Version: %s', qtpy.QT_VERSION)
passed = True
if QtCore.PYQT_VERSION < 0x40800:
if version.LooseVersion(qtpy.PYQT_VERSION) < '4.8':
logger.error(
'This version of PyQt is too old. PyBitmessage requries'
' PyQt 4.8 or later.')
passed = False
if QtCore.QT_VERSION < 0x40700:
if version.LooseVersion(qtpy.QT_VERSION) < '4.7':
logger.error(
'This version of Qt is too old. PyBitmessage requries'
' Qt 4.7 or later.')
Expand All @@ -408,7 +409,7 @@ def check_pyqt():


def check_msgpack():
"""Do sgpack module check.
"""Do msgpack module check.
simply checking if msgpack package with all its dependency
is available or not as recommended for messages coding.
Expand Down

0 comments on commit aaf7e03

Please sign in to comment.