Skip to content

Commit 5d87d68

Browse files
committed
allow numpy 2.x to pass check for numpy >= 1.1 (reported by Nadia Dencheva)
svn path=/trunk/matplotlib/; revision=8128
1 parent b62531e commit 5d87d68

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

lib/matplotlib/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,10 @@
147147
import numpy
148148
nn = numpy.__version__.split('.')
149149
if not (int(nn[0]) >= 1 and int(nn[1]) >= 1):
150-
raise ImportError(
151-
'numpy 1.1 or later is required; you have %s' % numpy.__version__)
150+
if not (int(nn[0]) >= 2):
151+
raise ImportError(
152+
'numpy 1.1 or later is required; you have %s' %
153+
numpy.__version__)
152154

153155
def is_string_like(obj):
154156
if hasattr(obj, 'shape'): return 0

setupext.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -516,9 +516,11 @@ def check_for_numpy():
516516
return False
517517
nn = numpy.__version__.split('.')
518518
if not (int(nn[0]) >= 1 and int(nn[1]) >= 1):
519-
print_message(
520-
'numpy 1.1 or later is required; you have %s' % numpy.__version__)
521-
return False
519+
if not (int(nn[0]) >= 2):
520+
print_message(
521+
'numpy 1.1 or later is required; you have %s' %
522+
numpy.__version__)
523+
return False
522524
module = Extension('test', [])
523525
add_numpy_flags(module)
524526
add_base_flags(module)

0 commit comments

Comments
 (0)