From 34a1cb4f8d8b9794e2c84ce96e36808438cf826d Mon Sep 17 00:00:00 2001 From: Ludovico Bianchi Date: Wed, 21 Feb 2024 10:11:45 -0600 Subject: [PATCH] Address modified-iterating-set Pylint error --- idaes/core/dmf/commands.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/idaes/core/dmf/commands.py b/idaes/core/dmf/commands.py index 16043f0b7f..c30a011ee5 100644 --- a/idaes/core/dmf/commands.py +++ b/idaes/core/dmf/commands.py @@ -391,7 +391,9 @@ def cat_resources(path, objects=(), color=True): # get all resources, # display any that match an object as a prefix for r in d.find(): - for oid in unmatched: + # iterate on a copy of the set to avoid + # mutating an object being iterated on + for oid in set(unmatched): if r.uuid.startswith(oid): unmatched.remove(oid) # don't show twice if not first: