#1381 python: don't modify dict while iterating over it
Merged 3 years ago by praiskup. Opened 3 years ago by praiskup.

file modified
+1 -1
@@ -45,7 +45,7 @@

      """

      Apply a given decorator to all class methods

      """

-     for attr in cls.__dict__:

+     for attr in list(cls.__dict__):

          if callable(getattr(cls, attr)):

              setattr(cls, attr, decorator(getattr(cls, attr)))

  

LGTM

We should merge either way but let's see if Tomas confirms that it fixes the issue.

I was told on IRC that it actually seems it fixes the problem. It's not 100% clear:

<csomh> praiskup: fyi, applying the patch unblocked Packit and it's able to submit builds now
<csomh> not sure if it was changing the image or the patch itself was the solution, but we'll continue monitoring the situation and let you know if something goes south :)
<csomh> should I add an update to the bugzilla, or you'll do it?
<praiskup> as you wish, I'm going to track the bug ... close it when it is fixed, etc.
<praiskup> I mean, feel free to update the bug as you wish, anytime ;)

rebased onto 7f43f7b93c850ab4b1e6c170dfac6318c9f8ab43

3 years ago

rebased onto e8f503c

3 years ago

Pull-Request has been merged by praiskup

3 years ago