Message162527
@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__) |
|
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 | |
|