From 14146f84fe34dae6513507a004e8b87ce420246b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20=C5=A0milauer?= Date: Fri, 11 Feb 2022 12:15:17 +0100 Subject: [PATCH] Fix empty dict as default arg See e.g. https://towardsdatascience.com/python-pitfall-mutable-default-arguments-9385e8265422 --- cq_editor/widgets/object_tree.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cq_editor/widgets/object_tree.py b/cq_editor/widgets/object_tree.py index c0ea1dcf..2030bd19 100644 --- a/cq_editor/widgets/object_tree.py +++ b/cq_editor/widgets/object_tree.py @@ -269,7 +269,9 @@ def addObjects(self,objects,clean=False,root=None): self.sigObjectsAdded[list].emit(ais_list) @pyqtSlot(object,str,object) - def addObject(self,obj,name='',options={}): + def addObject(self,obj,name='',options=None): + + if options is None: options={} root = self.CQ