Closed thautwarm closed 3 years ago
when specialising, primitives like getattr(a, "attr") will be translated to PyObject_GetAttr(...) or PyObject_GetAttrString() or dynjit_get_member_by_offset(...), which might return NULL and can work with cython exception system.
getattr(a, "attr")
PyObject_GetAttr(...)
PyObject_GetAttrString()
dynjit_get_member_by_offset(...)
NULL
can achieve this via
cdef extern from "": """ static inline void* dynjit_py_err(){ return NULL; } """ object dynjit_py_err()
leveraging except keyword does this work. https://github.com/thautwarm/dynjit/blob/e614b363fd882e28953246f5e7be7d030e162f99/jit/ll/infr.pxd#L58
except
when specialising, primitives like
getattr(a, "attr")
will be translated toPyObject_GetAttr(...)
orPyObject_GetAttrString()
ordynjit_get_member_by_offset(...)
, which might returnNULL
and can work with cython exception system.can achieve this via