changeset: 97008:ce34c78ebf65 branch: 2.7 parent: 96993:b2f4d8377bce user: Robert Collins date: Thu Jul 23 06:19:18 2015 +1200 files: Lib/lib2to3/fixes/fix_types.py Lib/lib2to3/tests/test_fixers.py Misc/NEWS description: Issue #13938: 2to3 converts StringTypes to a tuple. Patch from Mark Hammond. diff -r b2f4d8377bce -r ce34c78ebf65 Lib/lib2to3/fixes/fix_types.py --- a/Lib/lib2to3/fixes/fix_types.py Tue Jul 21 23:17:16 2015 -0700 +++ b/Lib/lib2to3/fixes/fix_types.py Thu Jul 23 06:19:18 2015 +1200 @@ -42,7 +42,7 @@ 'NotImplementedType' : 'type(NotImplemented)', 'SliceType' : 'slice', 'StringType': 'bytes', # XXX ? - 'StringTypes' : 'str', # XXX ? + 'StringTypes' : '(str,)', # XXX ? 'TupleType': 'tuple', 'TypeType' : 'type', 'UnicodeType': 'str', diff -r b2f4d8377bce -r ce34c78ebf65 Lib/lib2to3/tests/test_fixers.py --- a/Lib/lib2to3/tests/test_fixers.py Tue Jul 21 23:17:16 2015 -0700 +++ b/Lib/lib2to3/tests/test_fixers.py Thu Jul 23 06:19:18 2015 +1200 @@ -3263,6 +3263,10 @@ a = """type(None)""" self.check(b, a) + b = "types.StringTypes" + a = "(str,)" + self.check(b, a) + class Test_idioms(FixerTestCase): fixer = "idioms" diff -r b2f4d8377bce -r ce34c78ebf65 Misc/NEWS --- a/Misc/NEWS Tue Jul 21 23:17:16 2015 -0700 +++ b/Misc/NEWS Thu Jul 23 06:19:18 2015 +1200 @@ -34,6 +34,8 @@ Library ------- +- Issue #13938: 2to3 converts StringTypes to a tuple. Patch from Mark Hammond. + - Issue #24611: Fixed compiling the posix module on non-Windows platforms without mknod() or makedev() (e.g. on Unixware).