Skip to content
Browse files

cleaner error on pyzmq < 2.0.10.

  • Loading branch information...
1 parent 82eb507 commit b770b5f7a130b6a7c716b971ca6745220c827bb0 @minrk committed Feb 11, 2011
Showing with 25 additions and 0 deletions.
  1. +25 −0 IPython/zmq/__init__.py
View
25 IPython/zmq/__init__.py
@@ -0,0 +1,25 @@
+#-----------------------------------------------------------------------------
+# Copyright (C) 2010 The IPython Development Team
+#
+# Distributed under the terms of the BSD License. The full license is in
+# the file COPYING.txt, distributed as part of this software.
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+# Verify zmq version dependency >= 2.0.10
+#-----------------------------------------------------------------------------
+
+minimum_pyzmq_version = "2.0.10"
+
+try:
+ import zmq
+except ImportError:
+ raise ImportError("IPython.zmq requires pyzmq >= %s"%minimum_pyzmq_version)
+
+pyzmq_version = zmq.__version__
+
+if pyzmq_version < minimum_pyzmq_version:
+ raise ImportError("IPython.zmq requires pyzmq >= %s, but you have %s"%(
+ minimum_pyzmq_version, pyzmq_version))
+
+del pyzmq_version

0 comments on commit b770b5f

Please sign in to comment.
Something went wrong with that request. Please try again.