summaryrefslogtreecommitdiffstats
path: root/Lib/pydoc.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-xLib/pydoc.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index e96cacb..a4dc910 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -1171,8 +1171,7 @@ class TextDoc(Doc):
def indent(self, text, prefix=' '):
"""Indent text by prepending a given prefix to each line."""
if not text: return ''
- lines = [prefix + line for line in text.split('\n')]
- if lines: lines[-1] = lines[-1].rstrip()
+ lines = [(prefix + line).rstrip() for line in text.split('\n')]
return '\n'.join(lines)
def section(self, title, contents):