Skip to content

Commit e929099

Browse files
committed
Use old stride_windows implementation on 32-bit x86
1 parent a300ee6 commit e929099

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/matplotlib/mlab.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252

5353
import functools
5454
from numbers import Number
55+
import sys
5556

5657
import numpy as np
5758

@@ -252,7 +253,9 @@ def stride_windows(x, n, noverlap=None, axis=0):
252253

253254
def _stride_windows(x, n, noverlap=0, axis=0):
254255
# np>=1.20 provides sliding_window_view, and we only ever use axis=0.
255-
if hasattr(np.lib.stride_tricks, "sliding_window_view") and axis == 0:
256+
if (sys.maxsize > 2**32 and # NumPy version on 32-bit OOMs.
257+
hasattr(np.lib.stride_tricks, "sliding_window_view") and
258+
axis == 0):
256259
if noverlap >= n:
257260
raise ValueError('noverlap must be less than n')
258261
return np.lib.stride_tricks.sliding_window_view(

0 commit comments

Comments
 (0)