Skip to content

Commit

Permalink
Ensure positions always sort
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed May 31, 2022
1 parent 113e1d8 commit bca9e48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sphinx/builders/gettext.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def add(self, msg: str, origin: Union[Element, "MsgOrigin"]) -> None:

def __iter__(self) -> Generator[Message, None, None]:
for message in self.messages:
positions = sorted(set((source, line) for source, line, uuid
positions = sorted(set((source, line or -1) for source, line, uuid
in self.metadata[message]))
uuids = [uuid for source, line, uuid in self.metadata[message]]
yield Message(message, positions, uuids)
Expand Down

0 comments on commit bca9e48

Please sign in to comment.