[Spice-devel] [spice-common PATCH v2] codegen: ptypes.py: keep attribute names in sets

Christophe Fergeau cfergeau at redhat.com
Tue Aug 4 00:51:01 PDT 2015


ACK.


On Mon, Aug 03, 2015 at 07:04:36PM +0300, Uri Lublin wrote:
> This patch changes the type of 'valid_attributes' and
> 'attributes_with_arguments'.
> Both of them are list of different strings and are kept in sets.
> 
> This was the intention of the original code, but this patch
> use a specific set([ strings ]) format, instead of { strings }.
> 
> This fixes the build for me on RHEL-6 (python-2.6.6).
> Build error is:
> 
> File "/home/ulublin/git/spice/spice-common/python_modules/ptypes.py",
> line 67
>       'end',
>            ^
> SyntaxError: invalid syntax
> ---
> 
> v1 -> v2 changes: following a review comment by Frediano
>    - use sets instead of lists.
> 
> ---
>  python_modules/ptypes.py |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/python_modules/ptypes.py b/python_modules/ptypes.py
> index efbe9b6..7ab2771 100644
> --- a/python_modules/ptypes.py
> +++ b/python_modules/ptypes.py
> @@ -62,7 +62,7 @@ class FixedSize:
>  # other members
>  propagated_attributes=["ptr_array", "nonnull", "chunk"]
>  
> -valid_attributes={
> +valid_attributes=set([
>      # embedded/appended at the end of the structure
>      'end',
>      # the C structure contains a pointer to data
> @@ -108,9 +108,9 @@ valid_attributes={
>      # for a switch this indicates that on network
>      # it will occupy always the same size (maximum size required for all members)
>      'fixedsize',
> -}
> +])
>  
> -attributes_with_arguments={
> +attributes_with_arguments=set([
>      'ctype',
>      'prefix',
>      'as_ptr',
> @@ -119,7 +119,7 @@ attributes_with_arguments={
>      'minor',
>      'bytes_count',
>      'virtual',
> -}
> +])
>  
>  def fix_attributes(attribute_list):
>      attrs = {}
> -- 
> 1.7.1
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20150804/b9e047d4/attachment-0001.sig>


More information about the Spice-devel mailing list