summaryrefslogtreecommitdiff
path: root/sphinx/util/docstrings.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2019-03-24 01:22:30 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2019-04-25 21:44:44 +0900
commit1ea23e14df871ff97aa4082dddecfd11c4465cbe (patch)
tree9be4792098d586afa0d18af089cb6ea9dd305fdc /sphinx/util/docstrings.py
parentde0c44196e6c9f8ea9ec5dd58098f83dae93277d (diff)
downloadsphinx-git-1ea23e14df871ff97aa4082dddecfd11c4465cbe.tar.gz
Fix #6165: autodoc: ``tab_width`` setting of docutils has been ignored
Diffstat (limited to 'sphinx/util/docstrings.py')
-rw-r--r--sphinx/util/docstrings.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/sphinx/util/docstrings.py b/sphinx/util/docstrings.py
index 97dd60294..31943b2cb 100644
--- a/sphinx/util/docstrings.py
+++ b/sphinx/util/docstrings.py
@@ -15,8 +15,8 @@ if False:
from typing import List # NOQA
-def prepare_docstring(s, ignore=1):
- # type: (str, int) -> List[str]
+def prepare_docstring(s, ignore=1, tabsize=8):
+ # type: (str, int, int) -> List[str]
"""Convert a docstring into lines of parseable reST. Remove common leading
indentation, where the indentation of a given number of lines (usually just
one) is ignored.
@@ -25,7 +25,7 @@ def prepare_docstring(s, ignore=1):
ViewList (used as argument of nested_parse().) An empty line is added to
act as a separator between this docstring and following content.
"""
- lines = s.expandtabs().splitlines()
+ lines = s.expandtabs(tabsize).splitlines()
# Find minimum indentation of any non-blank lines after ignored lines.
margin = sys.maxsize
for line in lines[ignore:]: