Skip to content

Commit 6a74aa7

Browse files
committed
Fix bidict.ValueDuplicationError
1 parent 925990e commit 6a74aa7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/fundus/utils/events.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from collections import defaultdict
33
from typing import Dict, List, Optional, Union
44

5-
from bidict import bidict
5+
from bidict import ON_DUP_DROP_OLD, bidict
66

77
from fundus.logging import create_logger
88

@@ -142,7 +142,7 @@ def _alias(self, alias: str, key: Optional[int] = None):
142142
key: The thread identifier to associate with this alias.
143143
If None, the current thread's identifier is used.
144144
"""
145-
self._aliases[alias] = key if key else self._get_identifier()
145+
self._aliases.put(alias, key if key else self._get_identifier(), ON_DUP_DROP_OLD)
146146
if (ident := self._resolve(alias)) not in self._events:
147147
# noinspection PyStatementEffect
148148
# Since defaultdict doesn't provide a direct way to create defaults,

0 commit comments

Comments
 (0)