From: <ef...@us...> - 2010-06-14 01:49:18
|
Revision: 8431 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8431&view=rev Author: efiring Date: 2010-06-14 01:49:12 +0000 (Mon, 14 Jun 2010) Log Message: ----------- numpy version check: make it more readable Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/__init__.py Modified: trunk/matplotlib/lib/matplotlib/__init__.py =================================================================== --- trunk/matplotlib/lib/matplotlib/__init__.py 2010-06-14 01:17:23 UTC (rev 8430) +++ trunk/matplotlib/lib/matplotlib/__init__.py 2010-06-14 01:49:12 UTC (rev 8431) @@ -145,12 +145,10 @@ raise ImportError('matplotlib requires Python 2.4 or later') import numpy -nn = numpy.__version__.split('.') -if not (int(nn[0]) >= 1 and int(nn[1]) >= 1): - if not (int(nn[0]) >= 2): - raise ImportError( - 'numpy 1.1 or later is required; you have %s' % - numpy.__version__) +nmajor, nminor = [int(n) for n in numpy.__version__.split('.')[:2]] +if not (nmajor > 1 or (nmajor == 1 and nminor >= 1)): + raise ImportError( + 'numpy 1.1 or later is required; you have %s' % numpy.__version__) def is_string_like(obj): if hasattr(obj, 'shape'): return 0 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |