From 7e3151dd734e3da48741b0150400a26275055bd9 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Tue, 4 Jan 2011 23:39:13 +0100 Subject: [PATCH] #581: Fix traceback in Python domain for empty cross-reference targets. --- CHANGES | 3 +++ sphinx/domains/python.py | 2 +- tests/root/objects.txt | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index ac50bd910..b89665b3c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ Release 1.0.6 (in development) ============================== +* #581: Fix traceback in Python domain for empty cross-reference + targets. + * #283: Fix literal block display issues on Chrome browsers. * #383, #148: Support sorting a limited range of accented characters diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py index 4c216a434..d2242cdda 100644 --- a/sphinx/domains/python.py +++ b/sphinx/domains/python.py @@ -585,7 +585,7 @@ class PythonDomain(Domain): name = name[:-2] if not name: - return None, None + return [] objects = self.data['objects'] matches = [] diff --git a/tests/root/objects.txt b/tests/root/objects.txt index 7b70b0624..0b71761e4 100644 --- a/tests/root/objects.txt +++ b/tests/root/objects.txt @@ -13,6 +13,9 @@ Testing object descriptions .. function:: func_with_module :module: foolib +Referring to :func:`func with no index `. +Referring to :func:`nothing <>`. + .. module:: mod :synopsis: Module synopsis. :platform: UNIX