Better error message for non-string list elements ... (quixote/html.py)

Greg Ward <gward-fVcApmY9cLvQ3/1i3zOLAti2O/[email protected]> Wed, 20 Nov 2002 14:36:43 -0500
Newsgroups gmane.comp.web.quixote.cvs
Message-ID <[email protected]>
Update of /home/cvs/quixote
In directory hewson:/tmp/cvs-serv18660

Modified Files:
	html.py 
Log Message:
Better error message for non-string list elements in htmltext.join().


Index: html.py
===================================================================
RCS file: /home/cvs/quixote/html.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- html.py	29 Oct 2002 19:53:49 -0000	1.19
+++ html.py	20 Nov 2002 19:36:41 -0000	1.20
@@ -173,9 +173,10 @@
             elif isinstance(item, StringType):
                 quoted_items.append(self.quote(item))
             else:
-                raise TypeError, 'join request string arguments'
+                raise TypeError(
+                    'join() requires string arguments (got %r)' % item)
         return self.__class__(self.s.join(quoted_items))
-        
+
     def startswith(self, s):
         if isinstance(s, htmltext):
             s = s.s