Kaydet (Commit) 72e110c1 authored tarafından Collin Winter's avatar Collin Winter

Fix a bug from the map->itertools.imap conversion.

üst 2698631d
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment