]> git.proxmox.com Git - ovs.git/commit
python: KeyError shouldn't be raised from __getattr__
authorTimothy Redaelli <tredaelli@redhat.com>
Mon, 12 Mar 2018 10:52:21 +0000 (11:52 +0100)
committerRussell Bryant <russell@ovn.org>
Wed, 14 Mar 2018 15:34:27 +0000 (11:34 -0400)
commit63443bf315a263357aef84ff54f315df95a87a18
treea8032a0161cce39688a0a687437e99624487d213
parent8984b8034947f98d763b127f618a1db2dd0e6ddb
python: KeyError shouldn't be raised from __getattr__

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>
python/ovs/db/idl.py