<br><br><div class="gmail_quote">On Mon, Jun 1, 2009 at 8:43 PM, Robert Kern <span dir="ltr"><<a href="mailto:robert.kern@gmail.com">robert.kern@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Mon, Jun 1, 2009 at 21:37, <<a href="mailto:josef.pktd@gmail.com">josef.pktd@gmail.com</a>> wrote:<br>
> how do we catch a multiarray.error in a try except clause?<br>
><br>
> e.g.<br>
>>>> np.argmin([])<br>
> Traceback (most recent call last):<br>
> File "<pyshell#147>", line 1, in <module><br>
> np.argmin([])<br>
> File "C:\Programs\Python25\Lib\site-packages\numpy\core\fromnumeric.py",<br>
> line 631, in argmin<br>
> return _wrapit(a, 'argmin', axis)<br>
> File "C:\Programs\Python25\Lib\site-packages\numpy\core\fromnumeric.py",<br>
> line 37, in _wrapit<br>
> result = getattr(asarray(obj),method)(*args, **kwds)<br>
> multiarray.error: attempt to get argmax/argmin of an empty sequence<br>
<br>
</div>try:<br>
...<br>
except numpy.core.multiarray.error:<br>
...<br>
<br>
Unfortunately, that is still a string exception. We should change that.<br>
<font color="#888888"></font></blockquote><div><br>I'm fixing these, but doesn't that constitute an abi change? Code that used to catch the exceptions won't anymore.<br><br>Chuck <br></div><br></div><br>