Ever since <https://git.libreoffice.org/core/+/e80bdbafeba9af9b58aac81b999f4b299c9eecd6%5E!> "initial checkin for the pyuno-0.9.2 release" in 2003, the Runtime::any2PyObject function (in pyuno/source/module/pyuno_runtime.cxx; responsible for mapping from UNO any values to Python objects) contains the code

            // the exception base functions want to have an "args" tuple,
            // which contains the message
            PyObject_SetAttrString( ret.get(), "args", args.get() );

in the branch that handles UNO any values containing UNO exception values. It tries to set some args attribute on the resulting Python exception object, for reasons that are apparently intended to be explained by the preceding comment.

But in <https://git.libreoffice.org/core/+/7bdd020783f099069e7a0f11e89f8ecdef5985e3%5E%21> "Fix any2PyObject mapping of UNO exceptions" I now found out that that PyObject_SetAttrString call routinely causes a Python exception (which is not thrown immediately, but recorded in the Python C API's state). And I have no idea what that code is actually meant to do exactly, and I wonder: "And maybe that code is obsolete anyway [and] it would make even more sense to drop it altogether."

Does anybody have an idea what that code was/is supposed to actually be good and necessary for?

Reply via email to