Skip to content

Commit

Permalink
slob.py: fix probable bug of set iteration order, causing flaky test, #…
Browse files Browse the repository at this point in the history
  • Loading branch information
ilius committed Apr 17, 2024
1 parent 75b107c commit e66d99b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install \
PyICU==2.11 \
PyICU \
beautifulsoup4 \
biplist html5lib \
python-idzip \
Expand Down
4 changes: 2 additions & 2 deletions pyglossary/slob.py
Expand Up @@ -1312,13 +1312,13 @@ def read_key_frag(item: "Blob", default_fragment: str) -> "tuple[str, str]":
for item in resolved_aliases_reader:
ref = pickle.loads(item.content)
if previous is not None and ref.key != previous.key:
for bin_index, item_index, fragment in targets:
for bin_index, item_index, fragment in sorted(targets):
self._write_ref(previous.key, bin_index, item_index, fragment)
targets.clear()
targets.add((ref.bin_index, ref.item_index, ref.fragment))
previous = ref

for bin_index, item_index, fragment in targets:
for bin_index, item_index, fragment in sorted(targets):
self._write_ref(previous.key, bin_index, item_index, fragment)

self._sort()
Expand Down

0 comments on commit e66d99b

Please sign in to comment.