mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix py3.6b3 crashes with empty Callable annotation
This commit is contained in:
parent
07caa321d3
commit
7a6f2ae894
@ -293,7 +293,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])
|
||||
|
Loading…
Reference in New Issue
Block a user