Message97462
| Author |
michael.foord |
| Recipients |
michael.foord, r.david.murray, rbcollins, slmnhq |
| Date |
2010年01月09日.17:08:32 |
| SpamBayes Score |
1.9548272e-06 |
| Marked as misclassified |
No |
| Message-id |
<1263056915.24.0.578986955789.issue7559@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I'm unhappy with a straight change in behaviour because it will break code that is currently catching AttributeError.
A slightly less invasive change would be to raise an AttributeError if the module doesn't exist, otherwise letting the original error propagate.
That means distinguishing between a module not existing and an ImportError raised whilst importing the module. Example code that does this by walking the stack: http://twistedmatrix.com/trac/browser/trunk/twisted/python/reflect.py#L382
In addition we could add a new method that loads a test from name, returning an 'ErrorHolder' if loading the test fails. (A TestCase that reraises the original error when run - test discovery already does this in fact so that a test module failing to load doesn't halt discovery.) |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2010年01月09日 17:08:36 | michael.foord | set | recipients:
+ michael.foord, rbcollins, r.david.murray, slmnhq |
| 2010年01月09日 17:08:35 | michael.foord | set | messageid: <1263056915.24.0.578986955789.issue7559@psf.upfronthosting.co.za> |
| 2010年01月09日 17:08:33 | michael.foord | link | issue7559 messages |
| 2010年01月09日 17:08:33 | michael.foord | create |
|