summaryrefslogtreecommitdiffstats
path: root/Doc/tools
diff options
context:
space:
mode:
authorJulien Palard <julien@palard.fr>2019-09-09 10:54:56 (GMT)
committerGitHub <noreply@github.com>2019-09-09 10:54:56 (GMT)
commit63c98ed2d21d22b46f3517fd7dfd88f0c1521299 (patch)
tree5b9da87445109f46381664eeb1e2c1465c2d5402 /Doc/tools
parentbba9207248e2a777086d8525739693e3e9595f15 (diff)
downloadcpython-63c98ed2d21d22b46f3517fd7dfd88f0c1521299.zip
cpython-63c98ed2d21d22b46f3517fd7dfd88f0c1521299.tar.gz
cpython-63c98ed2d21d22b46f3517fd7dfd88f0c1521299.tar.bz2
Doc: Fix PDF build (NoUri). (GH-15739)
Diffstat (limited to 'Doc/tools')
-rw-r--r--Doc/tools/extensions/pyspecific.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py
index 8839033..975c87d 100644
--- a/Doc/tools/extensions/pyspecific.py
+++ b/Doc/tools/extensions/pyspecific.py
@@ -22,6 +22,10 @@ from docutils import nodes, utils
from sphinx import addnodes
from sphinx.builders import Builder
+try:
+ from sphinx.errors import NoUri
+except ImportError:
+ from sphinx.environment import NoUri
from sphinx.locale import translators
from sphinx.util import status_iterator, logging
from sphinx.util.nodes import split_explicit_title
@@ -569,10 +573,13 @@ def process_audit_events(app, doctree, fromdocname):
for i, (doc, label) in backlinks:
if isinstance(label, str):
ref = nodes.reference("", nodes.Text("[{}]".format(i)), internal=True)
- ref['refuri'] = "{}#{}".format(
- app.builder.get_relative_uri(fromdocname, doc),
- label,
- )
+ try:
+ ref['refuri'] = "{}#{}".format(
+ app.builder.get_relative_uri(fromdocname, doc),
+ label,
+ )
+ except NoUri:
+ continue
node += ref
row += nodes.entry('', node)