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 mhammond
Recipients mhammond
Date 2012-02-04.05:31:31
SpamBayes Score 1.6854926e-09
Marked as misclassified No
Message-id <1328333493.54.0.112859472866.issue13938@psf.upfronthosting.co.za>
In-reply-to
Content
test_types.py converts "types.StringTypes" to "str" - but types.StringTypes is a tuple, so expressions like "type(x) in type.StringTypes" fails after conversion with "TypeError: argument of type 'type' is not iterable"

Attaching a fix and test.

Note that the fixer still seems "strange" after this fix - types.StringType gets converted to "bytes" but types.StringTypes uses str.  This means the expression "type.StringType in type.StringTypes" evaluates to True in 2.x but False once converted - however, that should probably be tackled in a different bug - the fact the expression now causes a TypeError once converted is more blatantly wrong and the focus of this bug.
History
Date User Action Args
2012-02-04 05:31:33mhammondsetrecipients: + mhammond
2012-02-04 05:31:33mhammondsetmessageid: <1328333493.54.0.112859472866.issue13938@psf.upfronthosting.co.za>
2012-02-04 05:31:32mhammondlinkissue13938 messages
2012-02-04 05:31:32mhammondcreate