[Sugar-devel] [PATCH 16/21 sugar-toolkit] pylint cleanup: pass format parameters to log functions instead of using %

Simon Schampijer simon at schampijer.de
Fri Oct 29 06:58:28 EDT 2010


Reviewed-by: Simon Schampijer simon at laptop.org

On 10/15/2010 11:01 PM, Sascha Silbe wrote:
> This avoids the overhead from the string formatting on production systems.
>
> Signed-off-by: Sascha Silbe<sascha-pgp at silbe.org>
>
> diff --git a/src/sugar/wm.py b/src/sugar/wm.py
> index eaa196e..00c6fd0 100644
> --- a/src/sugar/wm.py
> +++ b/src/sugar/wm.py
> @@ -32,7 +32,7 @@ def _property_get_trapped(window, prop, prop_type):
>       error = gtk.gdk.error_trap_pop()
>       if error:
>           logging.debug('Received X Error (%i) while getting '
> -                      'a property on a window' % error)
> +                      'a property on a window', error)
>
>       return prop_info
>
> @@ -45,7 +45,7 @@ def _property_change_trapped(window, prop, prop_type, format, mode, data):
>       error = gtk.gdk.error_trap_pop()
>       if error:
>           logging.debug('Received X Error (%i) while setting '
> -                      'a property on a window' % error)
> +                      'a property on a window', error)
>           raise RuntimeError('Received X Error (%i) while setting '
>                              'a property on a window' % error)
>
> --
> 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