Skip to content

Commit

Permalink
Refs #29942 -- Fixed docs build on Python < 3.9 avoiding dict union o…
Browse files Browse the repository at this point in the history
…perator.

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.
  • Loading branch information
smithdc1 committed May 21, 2024
1 parent 480ccf9 commit 15fff62
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/_ext/github_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ def visit_ImportFrom(self, node):
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 ""
Expand Down

0 comments on commit 15fff62

Please sign in to comment.