From e21bc67bec7584ddea3b0f1021901d57ff150c4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= Date: Thu, 25 Jul 2019 10:56:53 +0300 Subject: [PATCH] Fixed regression caused by PR #87 --- CHANGELOG.rst | 6 ++++++ sphinx_autodoc_typehints.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index daa1aa0a..d5a20f3d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,9 @@ +1.7.1 +===== + +* Fixed regression which caused ``TypeErrors`` when trying to set annotations due to PR #87 + + 1.7.0 ===== diff --git a/sphinx_autodoc_typehints.py b/sphinx_autodoc_typehints.py index e863f420..3a7dffab 100644 --- a/sphinx_autodoc_typehints.py +++ b/sphinx_autodoc_typehints.py @@ -206,7 +206,7 @@ def get_all_type_hints(obj, name): try: obj.__annotations__ = rv - except AttributeError: + except (AttributeError, TypeError): return rv try: