summaryrefslogtreecommitdiff
path: root/docs/_ext/github_links.py
diff options
context:
space:
mode:
authorDavid Smith <39445562+smithdc1@users.noreply.github.com>2024-05-21 13:15:29 +0100
committerGitHub <noreply@github.com>2024-05-21 09:15:29 -0300
commit15fff62d5d8f28b6b61d63341535c9aafc64c865 (patch)
treef5bf3e9ca6f6089e6a92bc830521f0ce20179296 /docs/_ext/github_links.py
parent480ccf905560e2bc63be8cfd24355c557d404677 (diff)
Refs #29942 -- Fixed docs build on Python < 3.9 avoiding dict union operator.
The docs build process was failing on djangoproject.com since it uses Python 3.8 and the dict union operator was added in Python 3.9.
Diffstat (limited to 'docs/_ext/github_links.py')
-rw-r--r--docs/_ext/github_links.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/_ext/github_links.py b/docs/_ext/github_links.py
index 32af97186d..08f4161a01 100644
--- a/docs/_ext/github_links.py
+++ b/docs/_ext/github_links.py
@@ -41,10 +41,10 @@ class CodeLocator(ast.NodeVisitor):
file = module_name_to_file_path(node.module)
file_contents = file.read_text(encoding="utf-8")
locator = CodeLocator.from_code(file_contents)
- self.import_locations |= locator.import_locations
- self.import_locations |= {
- n: node.module for n in locator.node_line_numbers if "." not in n
- }
+ self.import_locations.update(locator.import_locations)
+ self.import_locations.update(
+ {n: node.module for n in locator.node_line_numbers if "." not in n}
+ )
else:
self.import_locations[alias.name] = ("." * node.level) + (
node.module or ""