[Mesa-dev] [PATCH 35/41] glapi: glX_proto_send.py: Don't shadow builtins.

Ian Romanick idr at freedesktop.org
Tue Apr 19 23:33:13 UTC 2016


This patch is

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

On 03/31/2016 05:04 PM, Dylan Baker wrote:
> str is a builtin in python, although python doesn't prevent builtins
> from being shadowed, its still a bad idea.
> 
> Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
> ---
>  src/mapi/glapi/gen/glX_proto_send.py | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/src/mapi/glapi/gen/glX_proto_send.py b/src/mapi/glapi/gen/glX_proto_send.py
> index 8ea799a..8fe0876 100644
> --- a/src/mapi/glapi/gen/glX_proto_send.py
> +++ b/src/mapi/glapi/gen/glX_proto_send.py
> @@ -38,18 +38,18 @@ import glX_proto_common
>  import license
>  
>  
> -def convertStringForXCB(str):
> +def convertStringForXCB(string_):
>      tmp = ""
>      special = ["ARB"]
>      i = 0
> -    while i < len(str):
> -        if str[i:i+3] in special:
> -            tmp = '%s_%s' % (tmp, str[i:i+3].lower())
> +    while i < len(string_):
> +        if string_[i:i+3] in special:
> +            tmp = '%s_%s' % (tmp, string_[i:i+3].lower())
>              i = i + 2
> -        elif str[i].isupper():
> -            tmp = '%s_%s' % (tmp, str[i].lower())
> +        elif string_[i].isupper():
> +            tmp = '%s_%s' % (tmp, string_[i].lower())
>          else:
> -            tmp = '%s%s' % (tmp, str[i])
> +            tmp = '%s%s' % (tmp, string_[i])
>          i += 1
>      return tmp
>  
> 



More information about the mesa-dev mailing list