Skip to content

Commit b3cda92

Browse files
committed
Merge pull request scikit-learn#3196 from andrewclegg/master
Fix for Python 3.x race condition causing "RuntimeError: dictionary changed size during iteration"
2 parents 110dd5c + c217d10 commit b3cda92

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sklearn/utils/testing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,9 +572,9 @@ def func(*args, **kwargs):
572572

573573

574574
def clean_warning_registry():
575-
"""Safe way to reset warniings """
575+
"""Safe way to reset warnings """
576576
warnings.resetwarnings()
577577
reg = "__warningregistry__"
578-
for mod in sys.modules.values():
578+
for mod in sys.modules.copy().values():
579579
if hasattr(mod, reg):
580580
getattr(mod, reg).clear()

0 commit comments

Comments
 (0)