GpuArray_empty don't set the python error? If so, new_GpuArray should do the same, so on line 160, you should set an error.