comparison sat_frontends/quick_frontend/quick_app.py @ 3193:65d89a339dd3

quick frontend (app): avoid crash when a listener is removed while being called
author Goffi <goffi@goffi.org>
date Fri, 28 Feb 2020 10:06:38 +0100
parents 84a94b385760
children fc2bea41e402
comparison
equal deleted inserted replaced
3192:883fb4981958 3193:65d89a339dd3
617 listeners = self._listeners[type_] 617 listeners = self._listeners[type_]
618 except KeyError: 618 except KeyError:
619 pass 619 pass
620 else: 620 else:
621 profile = kwargs.get("profile") 621 profile = kwargs.get("profile")
622 for listener, profiles_filter in listeners.items(): 622 for listener, profiles_filter in list(listeners.items()):
623 if profile is None or not profiles_filter or profile in profiles_filter: 623 if profile is None or not profiles_filter or profile in profiles_filter:
624 listener(*args, **kwargs) 624 listener(*args, **kwargs)
625 625
626 def check_profile(self, profile): 626 def check_profile(self, profile):
627 """Tell if the profile is currently followed by the application, and ready""" 627 """Tell if the profile is currently followed by the application, and ready"""