From f04adb1aa6dce9ff2b74883345c91c2916ae7e43 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Thu, 3 Nov 2016 10:00:35 +0900 Subject: [PATCH] Fix py3.6b3 crashes with empty Callable annotation --- sphinx/ext/autodoc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py index 208a228f0..1006d78b4 100644 --- a/sphinx/ext/autodoc.py +++ b/sphinx/ext/autodoc.py @@ -283,7 +283,7 @@ def format_annotation(annotation): # arguments are in __parameters__. params = None if hasattr(annotation, '__args__'): - if len(annotation.__args__) <= 2: + if annotation.__args__ is None or len(annotation.__args__) <= 2: params = annotation.__args__ else: # typing.Callable args = ', '.join(format_annotation(a) for a in annotation.__args__[:-1])