mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #7141 from tk0miya/7318_typehints_crashed_by_unboundobj
Fix #7138: autodoc: crashed when variable has unbound object
This commit is contained in:
commit
67abd960ed
3
CHANGES
3
CHANGES
@ -16,6 +16,9 @@ Features added
|
||||
Bugs fixed
|
||||
----------
|
||||
|
||||
* #7138: autodoc: ``autodoc.typehints`` crashed when variable has unbound object
|
||||
as a value
|
||||
|
||||
Testing
|
||||
--------
|
||||
|
||||
|
@ -46,7 +46,7 @@ def record_typehints(app: Sphinx, objtype: str, name: str, obj: Any,
|
||||
annotation[param.name] = typing.stringify(param.annotation)
|
||||
if sig.return_annotation is not sig.empty:
|
||||
annotation['return'] = typing.stringify(sig.return_annotation)
|
||||
except TypeError:
|
||||
except (TypeError, ValueError):
|
||||
pass
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user