##// END OF EJS Templates
avoid string version comparisons in external.qt...
MinRK -
Show More
@@ -7,7 +7,7 Do not use this if you need PyQt with the old QString/QVariant API.
7 7 """
8 8
9 9 import os
10
10 from distutils.version import LooseVersion as V
11 11 # Available APIs.
12 12 QT_API_PYQT = 'pyqt'
13 13 QT_API_PYSIDE = 'pyside'
@@ -26,7 +26,7 if QT_API is None:
26 26 pyside_found = False
27 27 try:
28 28 import PySide
29 if PySide.__version__ < '1.0.3':
29 if V(PySide.__version__) < V('1.0.3'):
30 30 # old PySide, fallback on PyQt
31 31 raise ImportError
32 32 # we can't import an incomplete pyside and pyqt4
@@ -49,7 +49,7 if QT_API is None:
49 49 "present.\nThis will likely crash, please install " \
50 50 "PySide completely, remove PySide or PyQt4 or set " \
51 51 "the QT_API environment variable to pyqt or pyside"
52 if QtCore.PYQT_VERSION_STR < '4.7':
52 if V(QtCore.PYQT_VERSION_STR) < V('4.7'):
53 53 # PyQt 4.6 has issues with null strings returning as None
54 54 raise ImportError
55 55 QT_API = QT_API_PYQT
@@ -63,7 +63,7 elif QT_API == QT_API_PYQT:
63 63 # Now peform the imports.
64 64 if QT_API == QT_API_PYQT:
65 65 from PyQt4 import QtCore, QtGui, QtSvg
66 if QtCore.PYQT_VERSION_STR < '4.7':
66 if V(QtCore.PYQT_VERSION_STR) < V('4.7'):
67 67 raise ImportError("IPython requires PyQt4 >= 4.7, found %s"%QtCore.PYQT_VERSION_STR)
68 68
69 69 # Alias PyQt-specific functions for PySide compatibility.
@@ -72,7 +72,7 if QT_API == QT_API_PYQT:
72 72
73 73 elif QT_API == QT_API_PYSIDE:
74 74 import PySide
75 if PySide.__version__ < '1.0.3':
75 if V(PySide.__version__) < V('1.0.3'):
76 76 raise ImportError("IPython requires PySide >= 1.0.3, found %s"%PySide.__version__)
77 77 from PySide import QtCore, QtGui, QtSvg
78 78
General Comments 0
You need to be logged in to leave comments. Login now