We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a67bf03 commit 0ddf6cdCopy full SHA for 0ddf6cd
lib/matplotlib/__init__.py
@@ -145,12 +145,10 @@
145
raise ImportError('matplotlib requires Python 2.4 or later')
146
147
import numpy
148
-nn = numpy.__version__.split('.')
149
-if not (int(nn[0]) >= 1 and int(nn[1]) >= 1):
150
- if not (int(nn[0]) >= 2):
151
- raise ImportError(
152
- 'numpy 1.1 or later is required; you have %s' %
153
- 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__)
154
155
def is_string_like(obj):
156
if hasattr(obj, 'shape'): return 0
0 commit comments