Skip to content

Commit

Permalink
numpy version check: make it more readable
Browse files Browse the repository at this point in the history
svn path=/trunk/matplotlib/; revision=8431
  • Loading branch information
efiring committed Jun 14, 2010
1 parent a67bf03 commit 0ddf6cd
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0ddf6cd

Please sign in to comment.