[Sugar-devel] [PATCH 19/21 sugar-toolkit] CellRendererInvoker._redraw_path(): assure column is defined

Simon Schampijer simon at schampijer.de
Fri Oct 29 07:03:38 EDT 2010


Reviewed-by: Simon Schampijer simon at laptop.org

On 10/15/2010 11:01 PM, Sascha Silbe wrote:
> We know that our code is correct and column should always be assigned, but it
> never hurts to act defensively and guard against bugs in other pieces of the
> code (or other components like GTK).
>
> Signed-off-by: Sascha Silbe<sascha-pgp at silbe.org>
>
> diff --git a/src/sugar/graphics/palettewindow.py b/src/sugar/graphics/palettewindow.py
> index c5deecd..9c3a02a 100644
> --- a/src/sugar/graphics/palettewindow.py
> +++ b/src/sugar/graphics/palettewindow.py
> @@ -938,9 +938,11 @@ class CellRendererInvoker(Invoker):
>               self.notify_mouse_leave()
>
>       def _redraw_path(self, path):
> +        column = None
>           for column in self._tree_view.get_columns():
>               if self._cell_renderer in column.get_cell_renderers():
>                   break
> +        assert column is not None
>           area = self._tree_view.get_background_area(path, column)
>           x, y = \
>               self._tree_view.convert_bin_window_to_widget_coords(area.x, area.y)
> --
> 1.7.1
>
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>



More information about the Sugar-devel mailing list