mojo icon indicating copy to clipboard operation
mojo copied to clipboard

[BUG] Ungraceful crash when indexing numpy array

Open hylkedonker opened this issue 10 months ago • 0 comments

Bug description

When I try to print the value of a Numpy array, mojo crashes with the following error message:

Unhandled exception caught during execution: expected 1 argument, got 2 mojo: error: execution exited with a non-zero result: 1

See the code snippet below. When I access the entire row (print(a[0]) instead of print(a[0, 0])) it works okay.

Steps to reproduce

from python import Python

def main():
    var np = Python.import_module("numpy")
    var height = 2
    var width = 2
    a = np.arange(height * width).reshape(height, width)
    print(a[0, 0])

System information

OS: Ubuntu 23.10
`mojo -v`: mojo 24.2.1 (2f0dcf11)
`modular -v`: modular 0.7.2 (d0adc668)

hylkedonker avatar Apr 20 '24 14:04 hylkedonker