--- IPython/external/qt.py.orig	2012-10-20 19:30:53.000000000 -0500
+++ IPython/external/qt.py	2013-03-05 15:56:01.000000000 -0600
@@ -7,6 +7,8 @@
 """
 
 import os
+import distutils.version as DV
+VER_LT = lambda a,b: DV.LooseVersion(a) < DV.LooseVersion(b)
 
 # Available APIs.
 QT_API_PYQT = 'pyqt'
@@ -25,7 +27,7 @@
 if QT_API is None:
     try:
         import PySide
-        if PySide.__version__ < '1.0.3':
+        if VER_LT(PySide.__version__, '1.0.3'):
             # old PySide, fallback on PyQt
             raise ImportError
         from PySide import QtCore, QtGui, QtSvg
@@ -35,7 +37,7 @@
             prepare_pyqt4()
             import PyQt4
             from PyQt4 import QtCore, QtGui, QtSvg
-            if QtCore.PYQT_VERSION_STR < '4.7':
+            if VER_LT(QtCore.PYQT_VERSION_STR, '4.7'):
                 # PyQt 4.6 has issues with null strings returning as None
                 raise ImportError
             QT_API = QT_API_PYQT
@@ -49,7 +51,7 @@
 # Now peform the imports.
 if QT_API == QT_API_PYQT:
     from PyQt4 import QtCore, QtGui, QtSvg
-    if QtCore.PYQT_VERSION_STR < '4.7':
+    if VER_LT(QtCore.PYQT_VERSION_STR, '4.7'):
         raise ImportError("IPython requires PyQt4 >= 4.7, found %s"%QtCore.PYQT_VERSION_STR)
 
     # Alias PyQt-specific functions for PySide compatibility.
@@ -58,7 +60,7 @@
 
 elif QT_API == QT_API_PYSIDE:
     import PySide
-    if PySide.__version__ < '1.0.3':
+    if VER_LT(PySide.__version__, '1.0.3'):
         raise ImportError("IPython requires PySide >= 1.0.3, found %s"%PySide.__version__)
     from PySide import QtCore, QtGui, QtSvg
 
