[Mesa-dev] [PATCH 6/7] genxml: use the isalpha method rather than str.isalpha.

Jason Ekstrand jason at jlekstrand.net
Tue May 31 21:33:16 UTC 2016


On Tue, May 31, 2016 at 2:30 PM, Dylan Baker <dylan at pnwbakers.com> wrote:

> This fixes gen_pack_header to work on python 2, where name[0] is unicode
> not str.
>
> Signed-off-by: Dylan Bake <dylanx.c.baker at intel.com>
> ---
>  src/intel/genxml/gen_pack_header.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/intel/genxml/gen_pack_header.py
> b/src/intel/genxml/gen_pack_header.py
> index 468bfea..5ef6744 100644
> --- a/src/intel/genxml/gen_pack_header.py
> +++ b/src/intel/genxml/gen_pack_header.py
> @@ -9,6 +9,7 @@ import re
>  import sys
>  import copy
>
> +
>

extra newline.

Also, I think this should go before patch 5


>  license =  """/*
>   * Copyright (C) 2016 Intel Corporation
>   *
> @@ -203,7 +204,7 @@ def to_alphanum(name):
>
>  def safe_name(name):
>      name = to_alphanum(name)
> -    if not str.isalpha(name[0]):
> +    if not name[0].isalpha():
>          name = '_' + name
>
>      return name
> --
> 2.8.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160531/46d0963d/attachment.html>


More information about the mesa-dev mailing list