On Python 3 hasattr only intercepts AttributeError exception.
On Python2, instead, hasattr intercepts all the exceptions.
This means __getattr__ shouldn't return KeyError when the attribute
doesn't exists, but it should raise AttributeError instead.
Fixes: 2d54d8011e14 ("Python-IDL: getattr after mutate fix")
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
assert self._changes is not None
assert self._mutations is not None
- column = self._table.columns[column_name]
+ try:
+ column = self._table.columns[column_name]
+ except KeyError:
+ raise AttributeError("%s instance has no attribute '%s'" %
+ (self.__class__.__name__, column_name))
datum = self._changes.get(column_name)
inserts = None
if '_inserts' in self._mutations.keys():