R. David Murray added the comment:

Yes, this is the right idea.

A couple of comments: I'm a bit concerned that the AttributeError might catch 
something other than the specific error generated by this case, but since that 
is unlikely and in any case would be revealed by the chained traceback, I think 
this is OK, and not worth the effort it
would take to narrow it.

The test, while correct, is IMO overbroad.  I prefer to only look for the 
essential parts of the message, which in this case would be mention of 'attach' 
and 'non-multipart'.  Thus the regex I suggested on irc for use in the test: 
'attach.*non-multipart'.

Also, you should wrap all lines to less than 79 characters, per PEP8.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11558>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to