File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -23,8 +23,10 @@ upgrading your version of coverage.py.
23
23
Unreleased
24
24
----------
25
25
26
- Nothing yet.
26
+ - Fix: in some cases, coverage could fail with a RuntimeError: "Set changed
27
+ size during iteration." This is now fixed, closing `issue 1733 `_.
27
28
29
+ .. _issue 1733 : https://github.com/nedbat/coveragepy/issues/1733
28
30
29
31
.. scriv-start-here
30
32
Original file line number Diff line number Diff line change @@ -513,9 +513,12 @@ def flush_data(self) -> bool:
513
513
# these packed ints.
514
514
arc_data : Dict [str , List [TArc ]] = {}
515
515
packed_data = cast (Dict [str , Set [int ]], self .data )
516
- for fname , packeds in packed_data .items ():
516
+
517
+ # The list() here and in the inner loop are to get a clean copy
518
+ # even as tracers are continuing to add data.
519
+ for fname , packeds in list (packed_data .items ()):
517
520
tuples = []
518
- for packed in packeds :
521
+ for packed in list ( packeds ) :
519
522
l1 = packed & 0xFFFFF
520
523
l2 = (packed & (0xFFFFF << 20 )) >> 20
521
524
if packed & (1 << 40 ):
You can’t perform that action at this time.
0 commit comments