From: Fredrik Tolf Date: Sun, 2 Nov 2014 02:10:10 +0000 (+0100) Subject: Handle subscribed callbacks unregistering themselves. X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=51c86362e0f20b1cb660b612f61f5f4e67b3cbd5;p=pdm.git Handle subscribed callbacks unregistering themselves. --- diff --git a/pdm/perf.py b/pdm/perf.py index fd4daa6..7aef95a 100644 --- a/pdm/perf.py +++ b/pdm/perf.py @@ -129,7 +129,7 @@ class eventobj(perfobj): def notify(self, event): """Notify all subscribers with the given event object.""" - for cb in self.subscribers: + for cb in list(self.subscribers): try: cb(event) except: pass