Merge "Avoid RuntimeError caused by iteration over sys.modules"

This commit is contained in:
Zuul 2023-12-13 22:58:48 +00:00 committed by Gerrit Code Review
commit cfbea4f743
1 changed files with 1 additions and 1 deletions

View File

@ -163,7 +163,7 @@ class YaqlEvaluatorTest(base.BaseTest):
def test_function_json_pp_deprecation(self):
with warnings.catch_warnings(record=True) as w:
# Ensure warnings aren't suppressed from other tests.
for name, mod in list(sys.modules.items()):
for name, mod in list(sys.modules.copy().items()):
getattr(mod, '__warningregistry__', dict()).clear()
warnings.simplefilter('always')