mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Closes #1159: do not emit duplicate inventory entries for py:module objects.
Also add a workaround on the consumer side in intersphinx, so that links to projects using old versions of Sphinx generate correct links.
This commit is contained in:
parent
a58c1332ff
commit
ff33545457
@ -706,4 +706,5 @@ class PythonDomain(Domain):
|
||||
for modname, info in self.data['modules'].iteritems():
|
||||
yield (modname, modname, 'module', info[0], 'module-' + modname, 0)
|
||||
for refname, (docname, type) in self.data['objects'].iteritems():
|
||||
yield (refname, refname, type, docname, refname, 1)
|
||||
if type != 'module': # modules are already handled
|
||||
yield (refname, refname, type, docname, refname, 1)
|
||||
|
@ -106,6 +106,12 @@ def read_inventory_v2(f, uri, join, bufsize=16*1024):
|
||||
if not m:
|
||||
continue
|
||||
name, type, prio, location, dispname = m.groups()
|
||||
if type == 'py:module' and type in invdata and \
|
||||
name in invdata[type]: # due to a bug in 1.1 and below,
|
||||
# two inventory entries are created
|
||||
# for Python modules, and the first
|
||||
# one is correct
|
||||
continue
|
||||
if location.endswith(u'$'):
|
||||
location = location[:-1] + name
|
||||
location = join(uri, location)
|
||||
|
Loading…
Reference in New Issue
Block a user