From bcf0fd6029d67f0bde834909d92f0194a72afc28 Mon Sep 17 00:00:00 2001 From: Shy Date: Tue, 21 Mar 2017 12:08:00 +0100 Subject: [PATCH] Make a copy of mutable list in pull() --- c4ctrl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/c4ctrl.py b/c4ctrl.py index 58013f0..c140a68 100755 --- a/c4ctrl.py +++ b/c4ctrl.py @@ -62,7 +62,7 @@ class C4Interface(): def pull(self, topic=[]): """Return current state of topic.""" from paho.mqtt import subscribe - topic = topic or self.topic + topic = topic.copy() or self.topic # must be a list if type(topic) == str: topic = [topic] @@ -1047,7 +1047,7 @@ if __name__ == "__main__": if args.k_switch != None: Keller().light_switch(args.k_switch) - # No command line options or only debug? + # No or no useful command line options? if len(sys.argv) <= 1 or len(sys.argv) == 2 and args.debug: parser.print_help()