Skip to content

Commit a0b0080

Browse files
committed
Debian Bug#585442: python-matplotlib: crashes when calling axis() after imshow()
This allows the C++ exception raised when Agg rendering complexity is exceeded to percolate up correctly to a Python exception, rather than crashing the interpreter. Fixes problem in last commit. svn path=/trunk/matplotlib/; revision=8455
1 parent 634b683 commit a0b0080

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

agg24/include/agg_rasterizer_cells_aa.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,16 +179,15 @@ namespace agg
179179
template<class Cell>
180180
AGG_INLINE void rasterizer_cells_aa<Cell>::add_curr_cell()
181181
{
182-
static Py::Exception e(
183-
Py::OverflowError(
184-
"Agg rendering complexity exceeded. Consider downsampling or decimating your data."));
185-
186-
187182
if(m_curr_cell.area | m_curr_cell.cover)
188183
{
189184
if((m_num_cells & cell_block_mask) == 0)
190185
{
191186
if(m_num_blocks >= cell_block_limit) {
187+
static Py::Exception e(
188+
Py::OverflowError(
189+
"Agg rendering complexity exceeded. Consider downsampling or decimating your data."));
190+
192191
/* If this exception is thrown too often, one can
193192
increase cell_block_limit */
194193
throw e;

0 commit comments

Comments
 (0)