1. Georg Brandl
  2. sphinx


armin.ronacher  committed 65d68ef

Fixed an bug with docstring outdenting in the autodoc extension

  • Participants
  • Parent commits 267ccbd
  • Branches default

Comments (0)

Files changed (1)

File sphinx/ext/autodoc.py

View file
  • Ignore whitespace
         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]:
+    # make sure there is an empty line at the end
+    if lines and lines[-1]:
+        lines.append('')
     return lines