[issue18156] Add an 'attr' attribute to AttributeError

Dražen Lučanin report at bugs.python.org
Sun Jul 7 15:34:34 CEST 2013


Dražen Lučanin added the comment:

OK, thanks for the feedback. I signed the CLA.

I'll then wait with the remaining work, until a final decision has been made. We have a rough idea of how it could be implemented if it comes to this - adding a wrapper function in Python/errors.c:

    PyErr_SetAttributeError(PyObject *attr, const char *format, ...)

that would replace all the PyErr_SetObject, PyErr_SetString and PyErr_Format calls (in around 50 files), create the kwargs object, format the message (if provided) and call PyErr_SetObject or PyErr_SetFormat.

I put the last patch as a commit in the attr bookmark on BitBucket (took me quite some time to figure out that's the alternative to git branches), so that subsequent changes go more easily.

----------
hgrepos: +203

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18156>
_______________________________________


More information about the Python-bugs-list mailing list