Skip to content

Commit

Permalink
Merge pull request #41 from astrofrog/fix-versions
Browse files Browse the repository at this point in the history
qtpy.__version__ should be QtPy version, not Qt version
  • Loading branch information
Nodd committed Jun 15, 2016
2 parents 4a2ef54 + 265d990 commit 69f16d3
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions qtpy/__init__.py
Expand Up @@ -52,6 +52,9 @@

import os

# Version of QtPy
from qtpy._version import __version__

#: Qt API environment variable name
QT_API = 'QT_API'
#: names of the expected PyQt5 api
Expand Down Expand Up @@ -79,7 +82,9 @@ class PythonQtError(Exception):

if API in PYQT5_API:
try:
from PyQt5.QtCore import PYQT_VERSION_STR as __version__
from PyQt5.Qt import PYQT_VERSION_STR as PYQT_VERSION # analysis:ignore
from PyQt5.Qt import QT_VERSION_STR as QT_VERSION # analysis:ignore
PYSIDE_VERSION = None
except ImportError:
API = 'pyqt'

Expand All @@ -97,8 +102,9 @@ class PythonQtError(Exception):
except AttributeError:
# PyQt < v4.6
pass

from PyQt4.QtCore import PYQT_VERSION_STR as __version__ # analysis:ignore
from PyQt4.Qt import PYQT_VERSION_STR as PYQT_VERSION # analysis:ignore
from PyQt4.Qt import QT_VERSION_STR as QT_VERSION # analysis:ignore
PYSIDE_VERSION = None
PYQT5 = False
PYQT4 = True
except ImportError:
Expand All @@ -109,7 +115,9 @@ class PythonQtError(Exception):

if API in PYSIDE_API:
try:
from PySide import __version__ # analysis:ignore
from PySide import __version__ as PYSIDE_VERSION # analysis:ignore
from PySide.QtCore import __version__ as QT_VERSION # analysis:ignore
PYQT_VERSION = None
PYQT5 = False
PYSIDE = True
except ImportError:
Expand Down

0 comments on commit 69f16d3

Please sign in to comment.