]> granicus.if.org Git - python/commitdiff
Fix a bug from the map->itertools.imap conversion.
authorCollin Winter <collinw@gmail.com>
Tue, 17 Jul 2007 00:27:30 +0000 (00:27 +0000)
committerCollin Winter <collinw@gmail.com>
Tue, 17 Jul 2007 00:27:30 +0000 (00:27 +0000)
Lib/pydoc.py

index 3b3f1bd959da08cf14e25175571eecccfd972bfd..f8fafa34e9a2c2756776d47f5e8b3dcee0182a4d 100755 (executable)
@@ -986,8 +986,7 @@ class TextDoc(Doc):
     def indent(self, text, prefix='    '):
         """Indent text by prepending a given prefix to each line."""
         if not text: return ''
-        lines = text.split('\n')
-        lines = map(lambda line, prefix=prefix: prefix + line, lines)
+        lines = [prefix + line for line in text.split('\n')]
         if lines: lines[-1] = lines[-1].rstrip()
         return '\n'.join(lines)