[ovs-dev] [PATCH RESEND] python/ovs/db/idl: getattr(Row) raises TypeError, not AttributeError.

Ben Pfaff blp at nicira.com
Thu Sep 27 16:13:16 UTC 2012


On Thu, Sep 27, 2012 at 06:29:45PM +0900, Isaku Yamahata wrote:
> In some cases getattr(Row instance, attrname) doesn't raise AttributeError,
> but TypeError
> 
> > File "python/ovs/db/idl.py", line 554, in __getattr__
> >     datum = self._data[column_name]
> > TypeError: 'NoneType' object has no attribute '__getitem__'
> 
> So getattr(Row instance, attrname, default value) doesn't work.
> This occurs when row._changes doesn't include attrname and row._data is None.
> So teach Row.__getattr__ _data=None case.
> 
> Signed-off-by: Isaku Yamahata <yamahata at valinux.co.jp>

Applied to master.  Thanks for reposting!

Let me know if this is causing trouble on any other branches and I'll
apply it there too.

Thanks,

Ben.



More information about the dev mailing list