commit | e19aa388e8f4aa88ef5e2a25444a06c2ec3408ad | [log] [tgz] |
---|---|---|
author | Antoine Pitrou <solipsis@pitrou.net> | Tue Oct 04 16:04:01 2011 +0200 |
committer | Antoine Pitrou <solipsis@pitrou.net> | Tue Oct 04 16:04:01 2011 +0200 |
tree | 886ac4e41e392672b8a2cea8c5ff11f85e7df58c | |
parent | 87a484caf556f0542ddf053fa4f87859cf59de44 [diff] [blame] |
When expandtabs() would be a no-op, don't create a duplicate string
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py index 4f6f132..840b76f 100644 --- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py
@@ -1585,6 +1585,10 @@ return self.assertRaises(OverflowError, 't\tt\t'.expandtabs, sys.maxsize) + def test_expandtabs_optimization(self): + s = 'abc' + self.assertIs(s.expandtabs(), s) + def test_raiseMemError(self): if struct.calcsize('P') == 8: # 64 bits pointers