diff options
author | Adam Turner <9087854+AA-Turner@users.noreply.github.com> | 2023-01-02 00:01:14 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-02 00:01:14 +0000 |
commit | 4032070e8131f518bbb8a04e8d63c5af4df9b59d (patch) | |
tree | 47b14f58d5337448e8358029264ebcd6d1ae7351 /sphinx/ext/viewcode.py | |
parent | ede68fa423107fbab74d07b307d7dcb03c00dfbd (diff) | |
download | sphinx-git-4032070e8131f518bbb8a04e8d63c5af4df9b59d.tar.gz |
Run pyupgrade (#11070)
Diffstat (limited to 'sphinx/ext/viewcode.py')
-rw-r--r-- | sphinx/ext/viewcode.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sphinx/ext/viewcode.py b/sphinx/ext/viewcode.py index 5bde12d6c..183c18406 100644 --- a/sphinx/ext/viewcode.py +++ b/sphinx/ext/viewcode.py @@ -307,10 +307,9 @@ def collect_pages(app: Sphinx) -> Generator[tuple[str, dict[str, Any], str], Non stack.pop() html.append('</ul>') stack.append(modname + '.') - html.append('<li><a href="%s">%s</a></li>\n' % ( - urito(posixpath.join(OUTPUT_DIRNAME, 'index'), - posixpath.join(OUTPUT_DIRNAME, modname.replace('.', '/'))), - modname)) + relative_uri = urito(posixpath.join(OUTPUT_DIRNAME, 'index'), + posixpath.join(OUTPUT_DIRNAME, modname.replace('.', '/'))) + html.append(f'<li><a href="{relative_uri}">{modname}</a></li>\n') html.append('</ul>' * (len(stack) - 1)) context = { 'title': _('Overview: module code'), |