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.
2323 Unreleased
2424----------
2525
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 `_.
2728
29+ .. _issue 1733 : https://github.com/nedbat/coveragepy/issues/1733
2830
2931.. scriv-start-here
3032
Original file line number Diff line number Diff line change @@ -513,9 +513,12 @@ def flush_data(self) -> bool:
513513 # these packed ints.
514514 arc_data : Dict [str , List [TArc ]] = {}
515515 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 ()):
517520 tuples = []
518- for packed in packeds :
521+ for packed in list ( packeds ) :
519522 l1 = packed & 0xFFFFF
520523 l2 = (packed & (0xFFFFF << 20 )) >> 20
521524 if packed & (1 << 40 ):
You can’t perform that action at this time.
0 commit comments