• Kirill Smelkov's avatar
    bigarray: Translate OverflowError when computing slice indices to MemoryError · fcbb26e6
    Kirill Smelkov authored
    OverflowError when computing slice indices practically means we'll
    cannot allocate so much address space at next step:
    
        In [1]: s = slice(None)
    
        In [2]: s.indices(1<<62)
        Out[2]: (0, 4611686018427387904, 1)
    
        In [3]: s.indices(1<<63)
        ---------------------------------------------------------------------------
        OverflowError                             Traceback (most recent call last)
        <ipython-input-4-5aa549641bc6> in <module>()
        ----> 1 s.indices(1<<63)
    
        OverflowError: cannot fit 'long' into an index-sized integer
    
    So translate this OverflowError into MemoryError (preserving message
    details), because we'll need such "no so much address space" cases to
    show up as MemoryError in a sooner patch.
    fcbb26e6
Name
Last commit
Last update
3rdparty Loading commit data...
bigarray Loading commit data...
bigfile Loading commit data...
demo Loading commit data...
include/wendelin Loading commit data...
lib Loading commit data...
t Loading commit data...
.gitignore Loading commit data...
.gitmodules Loading commit data...
CHANGES Loading commit data...
COPYING Loading commit data...
Makefile Loading commit data...
setup.py Loading commit data...
tox.ini Loading commit data...
wendelin.py Loading commit data...