Message162527
| Author |
Ramchandra Apte |
| Recipients |
Ramchandra Apte, loewis, orsenthil, roger.serwy, terry.reedy |
| Date |
2012年06月08日.13:40:26 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1339162827.17.0.719830127875.issue13532@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
@Roger Serwy
>> Does anyone know a good way to make the exception render as: "must be str, not int" instead of "must be str, not <class 'int'>" ?
Use s.__name__ rather than type(s) for the type name
e.g.
-raise TypeError('must be str, not %s' % type(s))
+raise TypeError('must be str, not %s' % s.__name__) |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年06月08日 13:40:27 | Ramchandra Apte | set | recipients:
+ Ramchandra Apte, loewis, terry.reedy, orsenthil, roger.serwy |
| 2012年06月08日 13:40:27 | Ramchandra Apte | set | messageid: <1339162827.17.0.719830127875.issue13532@psf.upfronthosting.co.za> |
| 2012年06月08日 13:40:26 | Ramchandra Apte | link | issue13532 messages |
| 2012年06月08日 13:40:26 | Ramchandra Apte | create |
|