I have embedded python interpreter in my application. I use it to run python scripts using PyRun_String() API. I can fetch error information using PyErr_F
The attributes are set on the the PySyntaxErrorObject struct, but be aware that the struct is not exposed if you are adhering to Python's stable ABI. Otherwise you should be able to use a PyObject_GetAttr* function to get at the attributes.