diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-04-23 22:21:39 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-05-02 14:32:16 +0900 |
commit | b8e41aa15f29fb68c956ade63fb67f2f03c5f6d1 (patch) | |
tree | b581fb9c02d321f5e406ec10d185cfeb04cff979 /sphinx/pycode/parser.py | |
parent | f82151bda5a7d061c382e4a70b09813433319842 (diff) | |
download | sphinx-git-b8e41aa15f29fb68c956ade63fb67f2f03c5f6d1.tar.gz |
refactor: Update type annotations
Diffstat (limited to 'sphinx/pycode/parser.py')
-rw-r--r-- | sphinx/pycode/parser.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sphinx/pycode/parser.py b/sphinx/pycode/parser.py index a77654939..7eb2419c0 100644 --- a/sphinx/pycode/parser.py +++ b/sphinx/pycode/parser.py @@ -93,7 +93,10 @@ def dedent_docstring(s: str) -> str: dummy.__doc__ = s docstring = inspect.getdoc(dummy) - return docstring.lstrip("\r\n").rstrip("\r\n") + if docstring: + return docstring.lstrip("\r\n").rstrip("\r\n") + else: + return "" class Token: |