Skip to content

Commit ccc5faf

Browse files
committed
fix(core): Avoid iterator changes during Event.notify when adding or removing new event handlers
1 parent bd9bcfd commit ccc5faf

File tree

1 file changed

+1
-1
lines changed
  • packages/core/src/robotcode/core

1 file changed

+1
-1
lines changed

packages/core/src/robotcode/core/event.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def __bool__(self) -> bool:
6565
return len(self._listeners) > 0
6666

6767
def __iter__(self) -> Iterator[Callable[_TParams, _TResult]]:
68-
for r in self._listeners:
68+
for r in list(self._listeners):
6969
c = r()
7070
if c is not None:
7171
yield c

0 commit comments

Comments
 (0)