From 4a517af21c9963d25ea64785b3ef53d23833b569 Mon Sep 17 00:00:00 2001 From: Takayuki Shimizukawa Date: Sat, 4 Oct 2014 23:21:03 +0900 Subject: [PATCH] fix: autosummary of modules broken in Sphinx-1.2.3. closes #1585 --- CHANGES | 1 + sphinx/ext/autosummary/__init__.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index a13654ee5..24bef95f4 100644 --- a/CHANGES +++ b/CHANGES @@ -21,6 +21,7 @@ Bugs fixed * #1576: Special toctree entry "self" located after another entry that also has a toctree was replaced with wrong title and 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) diff --git a/sphinx/ext/autosummary/__init__.py b/sphinx/ext/autosummary/__init__.py index c5c8f1519..8798e7f6b 100644 --- a/sphinx/ext/autosummary/__init__.py +++ b/sphinx/ext/autosummary/__init__.py @@ -58,6 +58,7 @@ import re import sys import inspect import posixpath +from types import ModuleType from docutils.parsers.rst import directives from docutils.statemachine import ViewList @@ -251,7 +252,7 @@ class Autosummary(Directive): self.result = ViewList() # initialize for each documenter full_name = real_name - if full_name.startswith(modname + '.'): + if not isinstance(obj, ModuleType): # give explicitly separated module name, so that members # of inner classes can be documented full_name = modname + '::' + full_name[len(modname)+1:]