Merge branch '2.4.x' into 2.x

This commit is contained in:
Takeshi KOMIYA
2020-02-19 01:27:58 +09:00
3 changed files with 16 additions and 9 deletions

15
CHANGES
View File

@@ -1,4 +1,4 @@
Release 2.4.2 (in development)
Release 2.4.3 (in development)
==============================
Dependencies
@@ -16,18 +16,25 @@ Features added
Bugs fixed
----------
Testing
--------
Release 2.4.2 (released Feb 19, 2020)
=====================================
Bugs fixed
----------
* #7138: autodoc: ``autodoc.typehints`` crashed when variable has unbound object
as a value
* #7156: autodoc: separator for keyword only arguments is not shown
* #7146: autodoc: IndexError is raised on suppressed type_comment found
* #7161: autodoc: typehints extension does not support parallel build
* #7178: autodoc: TypeError is raised on fetching type annotations
* #7151: crashed when extension assigns a value to ``env.indexentries``
* #7170: text: Remove debug print
* #7137: viewcode: Avoid to crash when non-python code given
Testing
--------
Release 2.4.1 (released Feb 11, 2020)
=====================================

View File

@@ -32,8 +32,8 @@ if 'PYTHONWARNINGS' not in os.environ:
warnings.filterwarnings('ignore', "'U' mode is deprecated",
DeprecationWarning, module='docutils.io')
__version__ = '2.4.2+'
__released__ = '2.4.2' # used when Sphinx builds its own docs
__version__ = '2.4.3+'
__released__ = '2.4.3' # used when Sphinx builds its own docs
#: Version info for better programmatic use.
#:
@@ -43,7 +43,7 @@ __released__ = '2.4.2' # used when Sphinx builds its own docs
#:
#: .. versionadded:: 1.2
#: Before version 1.2, check the string ``sphinx.__version__``.
version_info = (2, 4, 2, 'beta', 0)
version_info = (2, 4, 3, 'beta', 0)
package_dir = path.abspath(path.dirname(__file__))

View File

@@ -1236,7 +1236,7 @@ class DataDocumenter(ModuleLevelDocumenter):
if not self.options.annotation:
# obtain annotation for this data
annotations = getattr(self.parent, '__annotations__', {})
if self.objpath[-1] in annotations:
if annotations and self.objpath[-1] in annotations:
objrepr = stringify_typehint(annotations.get(self.objpath[-1]))
self.add_line(' :type: ' + objrepr, sourcename)
else:
@@ -1424,7 +1424,7 @@ class AttributeDocumenter(DocstringStripSignatureMixin, ClassLevelDocumenter):
if not self._datadescriptor:
# obtain annotation for this attribute
annotations = getattr(self.parent, '__annotations__', {})
if self.objpath[-1] in annotations:
if annotations and self.objpath[-1] in annotations:
objrepr = stringify_typehint(annotations.get(self.objpath[-1]))
self.add_line(' :type: ' + objrepr, sourcename)
else: