Clarify error message when any role has more than one target.

(by including the full names of the candidate targets)
This commit is contained in:
Antony Lee
2017-08-23 14:56:15 -07:00
parent 8b76d5b064
commit 65aa87c6e9

View File

@@ -134,7 +134,8 @@ class ReferencesResolver(SphinxTransform):
if not results:
return None
if len(results) > 1:
nice_results = ' or '.join(':%s:' % r[0] for r in results)
nice_results = ' or '.join(':%s:`%s`' % (name, role["reftitle"])
for name, role in results)
logger.warning(__('more than one target found for \'any\' cross-'
'reference %r: could be %s'), target, nice_results,
location=node)