From b2308bb9be492937764a99007f5fd49b75fbefee Mon Sep 17 00:00:00 2001 From: "Michael W. Hudson" Date: Fri, 21 Oct 2005 11:45:01 +0000 Subject: Fix bug: [ 1327110 ] wrong TypeError traceback in generator expressions by removing the code that can stomp on the users' TypeError raised by the iterable argument to ''.join() -- PySequence_Fast (now?) gives a perfectly reasonable message itself. Also, a couple of tests. --- Lib/test/string_tests.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Lib/test/string_tests.py') diff --git a/Lib/test/string_tests.py b/Lib/test/string_tests.py index 9f092b9793..60f5fdb2a5 100644 --- a/Lib/test/string_tests.py +++ b/Lib/test/string_tests.py @@ -657,6 +657,15 @@ class MixinStrUnicodeUserStringTest: self.checkraises(TypeError, ' ', 'join') self.checkraises(TypeError, ' ', 'join', 7) self.checkraises(TypeError, ' ', 'join', Sequence([7, 'hello', 123L])) + try: + def f(): + yield 4 + "" + self.fixtype(' ').join(f()) + except TypeError, e: + if '+' not in str(e): + self.fail('join() ate exception message') + else: + self.fail('exception not raised') def test_formatting(self): self.checkequal('+hello+', '+%s+', '__mod__', 'hello') -- cgit v1.2.1