summaryrefslogtreecommitdiff
path: root/tests/misc/cexample_subclass.py
AgeCommit message (Collapse)Author
2024-07-25py/objtype: Avoid crash on calling members of uninitialized native type.Laurens Valk
When subclassing a native type, calling native members in `__init__` before `super().__init__()` has been called could cause a crash. In this situation, `self` in `mp_convert_member_lookup` is the `native_base_init_wrapper_obj`. The check added in this commit ensures that an `AttributeError` is raised before this happens, which is consistent with other failed lookups. Also fix a typo in a related comment. Signed-off-by: Laurens Valk <laurens@pybricks.com>