diff --git a/__init__.py b/__init__.py index b853f6e..ce20ae1 100644 --- a/__init__.py +++ b/__init__.py @@ -83,7 +83,7 @@ class mqtt_client(object): def __receive__(self, client, userdata, message): logger.debug("Received message with topic %s and payload %s", message.topic, str(message.payload)) - for topic in self.__callbacks__: + for topic in self.__callbacks__.copy(): if topic.endswith('#'): if message.topic.startswith(topic[:-1]): self.__callbacks__[topic](client, userdata, message)