Skip to content

Commit 15fff62

Browse files
authored
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.
1 parent 480ccf9 commit 15fff62

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/_ext/github_links.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ def visit_ImportFrom(self, node):
4141
file = module_name_to_file_path(node.module)
4242
file_contents = file.read_text(encoding="utf-8")
4343
locator = CodeLocator.from_code(file_contents)
44-
self.import_locations |= locator.import_locations
45-
self.import_locations |= {
46-
n: node.module for n in locator.node_line_numbers if "." not in n
47-
}
44+
self.import_locations.update(locator.import_locations)
45+
self.import_locations.update(
46+
{n: node.module for n in locator.node_line_numbers if "." not in n}
47+
)
4848
else:
4949
self.import_locations[alias.name] = ("." * node.level) + (
5050
node.module or ""

0 commit comments

Comments
 (0)