fix: autosummary of modules broken in Sphinx-1.2.3. closes #1585

This commit is contained in:
Takayuki Shimizukawa 2014-10-04 23:21:03 +09:00
parent ee245c7bf1
commit 4a517af21c
2 changed files with 3 additions and 1 deletions

View File

@ -21,6 +21,7 @@ Bugs fixed
* #1576: Special toctree entry "self" located after another entry that also has * #1576: Special toctree entry "self" located after another entry that also has
a toctree was replaced with wrong title and link. a toctree was replaced with wrong title and link.
* #1584: Point to master doc in HTML "top" link. * #1584: Point to master doc in HTML "top" link.
* #1585: Autosummary of modules broken in Sphinx-1.2.3.
Release 1.2.3 (released Sep 1, 2014) Release 1.2.3 (released Sep 1, 2014)

View File

@ -58,6 +58,7 @@ import re
import sys import sys
import inspect import inspect
import posixpath import posixpath
from types import ModuleType
from docutils.parsers.rst import directives from docutils.parsers.rst import directives
from docutils.statemachine import ViewList from docutils.statemachine import ViewList
@ -251,7 +252,7 @@ class Autosummary(Directive):
self.result = ViewList() # initialize for each documenter self.result = ViewList() # initialize for each documenter
full_name = real_name full_name = real_name
if full_name.startswith(modname + '.'): if not isinstance(obj, ModuleType):
# give explicitly separated module name, so that members # give explicitly separated module name, so that members
# of inner classes can be documented # of inner classes can be documented
full_name = modname + '::' + full_name[len(modname)+1:] full_name = modname + '::' + full_name[len(modname)+1:]