Skip to content

Commit

Permalink
Address modified-iterating-set Pylint error
Browse files Browse the repository at this point in the history
  • Loading branch information
lbianchi-lbl committed Feb 21, 2024
1 parent 9484928 commit 34a1cb4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion idaes/core/dmf/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 34a1cb4

Please sign in to comment.