[Python-Dev] patch for review: unittest ImportError handling (original) (raw)

Michael Foord fuzzyman at voidspace.org.uk
Wed Apr 14 18:23:03 CEST 2010


On 14/04/2010 16:53, Nick Coghlan wrote:

Michael Foord wrote:

Changing the error message to provide more useful information, possibly including the original traceback, would certainly avoid the potential for incompatibility. I'd be interested in seeing what other folks here on python-dev think. Without looking at the details, my question is whether this can be ignored in 2.x and fixed for 3.x by setting cause appropriately (i.e. by using the "raise from" syntax).

Yes, definitely - if maintaining the exception as an AttributeError is determined to be the correct course of action for that API.

Chris showed an alternative way of achieving the same effect for Python 2, but that is possibly moot given that 2.7b1 is out (unless this is an acceptable bugfix to include in b2).

All the best,

Michael

Cheers, Nick.

-- http://www.ironpythoninaction.com/



More information about the Python-Dev mailing list