Fred - I don't know where the commit message body went, but I can resubmit if you want. commit 54976c74821316cdc21b80a886699b8f9c60bf9a Author: Weston Andros Adamson <dros@xxxxxxxxxx> Date: Tue Mar 6 22:15:17 2012 -0500 pynfs: Fix bug in xdrgen __repr__ generation 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. -dros On May 29, 2012, at 6:11 PM, <andros@xxxxxxxxxx> <andros@xxxxxxxxxx> wrote: > From: Weston Andros Adamson <dros@xxxxxxxxxx> > > Signed-off-by: Weston Andros Adamson <dros@xxxxxxxxxx> > --- > xdr/xdrgen.py | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff --git a/xdr/xdrgen.py b/xdr/xdrgen.py > index 0148f96..72954d1 100755 > --- a/xdr/xdrgen.py > +++ b/xdr/xdrgen.py > @@ -786,6 +786,8 @@ 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.7.6 >
Attachment:
smime.p7s
Description: S/MIME cryptographic signature