diff -r f89ef18f9824 Doc/tools/extensions/pyspecific.py --- a/Doc/tools/extensions/pyspecific.py Wed Dec 14 19:48:38 2016 +0200 +++ b/Doc/tools/extensions/pyspecific.py Wed Dec 14 20:41:52 2016 -0800 @@ -10,7 +10,9 @@ """ ISSUE_URI = 'https://bugs.python.org/issue%s' -SOURCE_URI = 'https://hg.python.org/cpython/file/2.7/%s' +SOURCE_URI = 'https://github.com/python/cpython/blob/%s/%s' + +import patchlevel from docutils import nodes, utils @@ -69,7 +71,11 @@ has_t, title, target = split_explicit_title(text) title = utils.unescape(title) target = utils.unescape(target) - refnode = nodes.reference(title, title, refuri=SOURCE_URI % target) + version, _ = patchlevel.get_version_info() + if version == "3.7": + version = "master" + refnode = nodes.reference(title, title, + refuri=SOURCE_URI % (version, target)) return [refnode], []