> @@ -230,19 +230,24 @@ class StringifyMixin(object):
>          return cls._get_default_decoder(decode_string)
>  
>      @classmethod
> -    def _decode_value(cls, k, json_value, decode_string=base64.b64decode):
> -        return cls._get_decoder(k, decode_string)(json_value)
> +    def _decode_value(cls, k, json_value, decode_string=base64.b64decode,
> +                      **additional_args):
> +        try:
> +            return cls._get_decoder(k, decode_string)(json_value)
> +        except TypeError:
> +            return cls._get_decoder(k, decode_string)(json_value,
> +                                                      **additional_args)

how about overriding ofproto_parser.StringifyMixin._decode_value
and make it test isinstance(cls, MsgBase) instead of this try-except?

YAMAMOTO Takashi

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to