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 /Doc/library/exceptions.rst | |
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 'Doc/library/exceptions.rst')
-rw-r--r-- | Doc/library/exceptions.rst | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/library/exceptions.rst b/Doc/library/exceptions.rst index 8c5a960..33bc3b0 100644 --- a/Doc/library/exceptions.rst +++ b/Doc/library/exceptions.rst @@ -159,6 +159,14 @@ The following exceptions are the exceptions that are usually raised. Raised when an :keyword:`import` statement fails to find the module definition or when a ``from ... import`` fails to find a name that is to be imported. + The :attr:`name` and :attr:`path` attributes can be set using keyword-only + arguments to the constructor. When set they represent the name of the module + that was attempted to be imported and the path to any file which triggered + the exception, respectively. + + .. versionchanged:: 3.3 + Added the :attr:`name` and :attr:`path` attributes. + .. exception:: IndexError |