You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Handle exceptions in numpy::array_view<...>::set().
set() can throw an exception; we must check for that to properly get
that exception propagated to the python side; otherwise we get a
SystemError ("method ... returned a result with an exception set").
Example repro:
```
from pylab import *
gca().add_collection(mpl.collections.LineCollection(rand(2, 2, 2), array=0))
```
(Here the C extension method receives a single tuple (rgba) color rather
than an array of tuple (rgba) colors.)
I'd rather not explicitly test for the exception being raised (a
ValueError) because if switching to pybind11 one naturally gets a
broadcast of the scalar value into a correctly dimensionalized array;
indeed mplcairo handles the above example just fine.
0 commit comments