[Python-Dev] _not_found attribute on ImportError

Chris Withers chris at simplistix.co.uk
Mon Feb 11 11:58:58 CET 2013


On 11/02/2013 10:54, Nick Coghlan wrote:
> On Mon, Feb 11, 2013 at 6:08 PM, Chris Withers<chris at simplistix.co.uk>  wrote:
>> Hi All,
>>
>> I see in Python 3, some ImportErrors have grown a '_not_found' attribute.
>> What's the significance of this attribute and where/how is it added?
>>
>> The only way I can seem to create this attribute is:
>>
>> ex = ImportError
>> ex._not_found = True
>
> It's something importlib does to get fromlists to behave the same way
> they did in the C implementation.
>
> It is set here:
> http://hg.python.org/cpython/file/3.3/Lib/importlib/_bootstrap.py

OK.

Have any other exceptions grown new attributes in Python 3?

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
             - http://www.simplistix.co.uk


More information about the Python-Dev mailing list