<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 11, 2013 at 9:23 AM, Barry Warsaw <span dir="ltr"><<a href="mailto:barry@python.org" target="_blank">barry@python.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">On Feb 11, 2013, at 09:23 PM, Nick Coghlan wrote:<br>


<br>
>On Mon, Feb 11, 2013 at 8:58 PM, Chris Withers <<a href="mailto:chris@simplistix.co.uk">chris@simplistix.co.uk</a>> wrote:<br>
>> Have any other exceptions grown new attributes in Python 3?<br>
><br>
>Off the top of my head, ImportError grew "name" and "path" attributes<br>
>in 3.3, everything grew __cause__, __context__ and __traceback__<br>
>attributes in 3.0 and the __suppress_context__ attribute in 3.3.<br>
><br>
>PEP 3151 may have moved a few attributes around in 3.3 as well.<br>
><br>
>If there are any others, you'll need to trawl the What's New documents<br>
>looking for them.<br>
<br>
</div>Those public attributes should be documented.</blockquote><div><br></div><div style>They are: <a href="http://docs.python.org/3.4/library/exceptions.html?highlight=importerror#ImportError">http://docs.python.org/3.4/library/exceptions.html?highlight=importerror#ImportError</a></div>

<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">  _not_found should not be since<br>
it's an implementation detail.</blockquote><div><br></div><div style>Yep, hence the leading underscore.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

  Also, Brett has left little TODO easter eggs<br>
in the code which clearly indicate changes he plans for 3.4, although I don't<br>
know where the plans for ModuleNotFound are documented.<br></blockquote><div><br></div><div><a href="http://bugs.python.org/issue15767">http://bugs.python.org/issue15767</a><br></div><div><br></div><div style>Basically it's a matter of choosing ModuleNotFound vs. ModuleNotFoundError and then writing the code.</div>

<div style><br></div><div style>-Brett</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
In the meantime, I just ran a test against trunk, with the following change<br>
and nothing broke afaict.<br>
<br>
diff -r a79650aacb43 Lib/importlib/_bootstrap.py<br>
--- a/Lib/importlib/_bootstrap.py       Mon Feb 11 13:33:00 2013 +0000<br>
+++ b/Lib/importlib/_bootstrap.py       Mon Feb 11 09:16:51 2013 -0500<br>
@@ -1640,6 +1640,7 @@<br>
                     # TODO(brett): In Python 3.4, have import raise<br>
                     #   ModuleNotFound and catch that.<br>
                     if getattr(exc, '_not_found', False):<br>
+                        del exc._not_found<br>
                         if <a href="http://exc.name" target="_blank">exc.name</a> == from_name:<br>
                             continue<br>
                     raise<br>
<br>
I won't commit this, but it really needs another hasattr() check to be<br>
completely valid.<br>
<br>
Cheers,<br>
-Barry<br>
<div class=""><div class="h5">_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-dev" target="_blank">http://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="http://mail.python.org/mailman/options/python-dev/brett%40python.org" target="_blank">http://mail.python.org/mailman/options/python-dev/brett%40python.org</a><br>
</div></div></blockquote></div><br></div></div>