Python pidl: avoid segfault with "del obj->attr"
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 4 May 2016 04:51:37 +0000 (16:51 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 9 May 2016 23:43:15 +0000 (01:43 +0200)
commited11ce8f12d567a3e0edc1d24aab1784a171ac33
tree9277cd9097d016491c7983c3056b9f37029bef40
parent2ba83ae49b34812ed165357e2bdcd1c4b627cad4
Python pidl: avoid segfault with "del obj->attr"

Deleting an attribute in Python (using the "del" statement) is (at
some stages along a winding path, for C objects) converted into
setting the attribute to NULL. Not None, actual NULL. The way we
handled this NULL was to dereference it. This changes the behaviour to
raising an AttributeError, which is more or less what Python does in
similar situations with builtin objects.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
pidl/lib/Parse/Pidl/Samba4/Python.pm