This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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 <>
@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
-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:27Ramchandra Aptesetrecipients: + Ramchandra Apte, loewis, terry.reedy, orsenthil, roger.serwy
2012-06-08 13:40:27Ramchandra Aptesetmessageid: <>
2012-06-08 13:40:26Ramchandra Aptelinkissue13532 messages
2012-06-08 13:40:26Ramchandra Aptecreate