diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2016-11-12 23:57:29 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2016-11-13 00:01:41 +0900 |
commit | 4ca84aba45109bad835bd300c8d9415b80c58269 (patch) | |
tree | 081341410b9e9bcaceb2352e6cf9a14002eb24f7 /sphinx/ext/autodoc.py | |
parent | a2102d66ecd7a1232970c414bbcb3e19ccf2339a (diff) | |
download | sphinx-git-4ca84aba45109bad835bd300c8d9415b80c58269.tar.gz |
Fix #3135: ``sphinx.ext.autodoc`` crashes with plain Callable
Diffstat (limited to 'sphinx/ext/autodoc.py')
-rw-r--r-- | sphinx/ext/autodoc.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py index 1006d78b4..e210e7266 100644 --- a/sphinx/ext/autodoc.py +++ b/sphinx/ext/autodoc.py @@ -306,7 +306,9 @@ def format_annotation(annotation): hasattr(annotation, '__args__') and \ hasattr(annotation, '__result__'): args = annotation.__args__ - if args is Ellipsis: + if args is None: + return qualified_name + elif args is Ellipsis: args_str = '...' else: formatted_args = (format_annotation(a) for a in args) |