[Python-checkins] r64886 - doctools/trunk/sphinx/ext/autodoc.py
armin.ronacher
python-checkins at python.org
Sat Jul 12 02:11:56 CEST 2008
Author: armin.ronacher
Date: Sat Jul 12 02:11:55 2008
New Revision: 64886
Log:
Fixed an bug with docstring outdenting in the autodoc extension
Modified:
doctools/trunk/sphinx/ext/autodoc.py
Modified: doctools/trunk/sphinx/ext/autodoc.py
==============================================================================
--- doctools/trunk/sphinx/ext/autodoc.py (original)
+++ doctools/trunk/sphinx/ext/autodoc.py Sat Jul 12 02:11:55 2008
@@ -172,11 +172,12 @@
lines[0] = lines[0].lstrip()
if margin < sys.maxint:
for i in range(1, len(lines)): lines[i] = lines[i][margin:]
- # Remove any trailing or leading blank lines.
- while lines and not lines[-1]:
- lines.pop()
+ # Remove any leading blank lines.
while lines and not lines[0]:
lines.pop(0)
+ # make sure there is an empty line at the end
+ if lines and lines[-1]:
+ lines.append('')
return lines
More information about the Python-checkins
mailing list