From 24f847049ff827de9e14e4cb3fd15a3fde086aa5 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 16 Aug 2018 09:24:24 -0400 Subject: [PATCH] Use list() to avoid size change during iteration Since we want to delete as we iterate, use list() to make a copy that will survive modification during iteration. Change-Id: I4b0425acbe01a84a47d6cbaa2138e8bc908b2dfe --- pyghmi/ipmi/private/session.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyghmi/ipmi/private/session.py b/pyghmi/ipmi/private/session.py index 9c647d82..f8893156 100644 --- a/pyghmi/ipmi/private/session.py +++ b/pyghmi/ipmi/private/session.py @@ -118,7 +118,7 @@ def define_worker(): for w in iowaiters: w[1].set() iowaiters = [] - for d in directediowaiters: + for d in list(directediowaiters): # these are the existing waiters that didn't get # satisfied last graball, allow them to set a new # deadline if they still have time waiting, or