Commits

Jason R. Coombs committed b2b9c83

Since the IRC lib no longer allows transmitting newlines, pmxbot should also not retain newlines when they're present in a handler result.

  • Participants
  • Parent commits e717880

Comments (0)

Files changed (1)

pmxbot/itertools.py

 	>>> list(always_iterable('foo'))
 	[u'foo']
 	>>> list(always_iterable('foo\nbar'))
-	[u'foo\n', u'bar']
+	[u'foo', u'bar']
 
 	>>> list(always_iterable([1,2,3]))
 	[1, 2, 3]
 		item = ()
 
 	if isinstance(item, basestring):
-		item = io.StringIO(unicode(item))
+		item = (line.rstrip('\n') for line in io.StringIO(unicode(item)))
 
 	if not hasattr(item, '__iter__'):
 		item = item,