numpy/numpy — pull request #3002 by seberg (2013-02-18 22:36:05+00:00)
Title: BUG: Incref items in np.take on error as they are decrefed later

When take fails during copying due to out of bound indices, then the already
copied items will be decref'd on array destruction. To avoid that, we need
to incref them first. Another solution would be to keep correctly track
of references while copying, which is what put/putmask do.

--

Fixes issue gh-3001