Remove use of PyObject_GenericGetAttr, which causes incorrect exception
behaviour through Cython