diff options
author | Brett Cannon <brett@python.org> | 2012-04-13 00:24:54 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2012-04-13 00:24:54 (GMT) |
commit | 79ec55e980d7b205bbc78d44e0892d0ef37d3abb (patch) | |
tree | 7fca6e94007fd848ec36ba029aee3b1ec2a8785c /Include | |
parent | f50b38a11fa951582b7f1656685201269f265784 (diff) | |
download | cpython-79ec55e980d7b205bbc78d44e0892d0ef37d3abb.zip cpython-79ec55e980d7b205bbc78d44e0892d0ef37d3abb.tar.gz cpython-79ec55e980d7b205bbc78d44e0892d0ef37d3abb.tar.bz2 |
Issue #1559549: Add 'name' and 'path' attributes to ImportError.
Currently import does not use these attributes as they are planned
for use by importlib (which will be another commit).
Thanks to Filip GruszczyĆski for the initial patch and Brian Curtin
for refining it.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/pyerrors.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Include/pyerrors.h b/Include/pyerrors.h index 1e42ebb..a550705 100644 --- a/Include/pyerrors.h +++ b/Include/pyerrors.h @@ -231,6 +231,13 @@ PyAPI_FUNC(PyObject *) PyErr_Format( ... ); +typedef struct { + PyException_HEAD + PyObject *msg; + PyObject *name; + PyObject *path; +} PyImportErrorObject; + #ifdef MS_WINDOWS PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilename( int ierr, @@ -256,6 +263,12 @@ PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithUnicodeFilename( PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErr(PyObject *, int); #endif /* MS_WINDOWS */ +PyAPI_FUNC(PyObject *) PyErr_SetExcWithArgsKwargs(PyObject *, PyObject *, + PyObject *); +PyAPI_FUNC(PyObject *) PyErr_SetFromImportErrorWithNameAndPath(PyObject *, + PyObject *, PyObject *); +PyAPI_FUNC(PyObject *) PyErr_SetFromImportErrorWithName(PyObject *, PyObject *); + /* Export the old function so that the existing API remains available: */ PyAPI_FUNC(void) PyErr_BadInternalCall(void); PyAPI_FUNC(void) _PyErr_BadInternalCall(const char *filename, int lineno); |