If an enum type is defined as opaque the generated __repr__ function raises an exception trying to use the list as a key for a dict.get() lookup. Signed-off-by: Weston Andros Adamson <dros@xxxxxxxxxx> --- xdr/xdrgen.py | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/xdr/xdrgen.py b/xdr/xdrgen.py index 0148f96..6d89bfe 100755 --- a/xdr/xdrgen.py +++ b/xdr/xdrgen.py @@ -786,6 +786,9 @@ class Info(object): if t.type in name_dict: p = name_dict[t.type] if p.parent and p.type == 'enum': + if t.array: + return "( '(' + ', '.join([ const.%s.get(x, x) " \ + "for x in self.%s ]) + ')' )" % (p.id, t.id) return "const.%s.get(self.%s, self.%s)" % (p.id, t.id, t.id) return "repr(self.%s)" % t.id indent2 = prefix + indent -- 1.7.4.4 -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html