[meld] ui.msgarea: Fix mutable default argument



commit a4df652a360152d47c15882881a1a810ab3eb43f
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Dec 31 09:56:51 2017 +1000

    ui.msgarea: Fix mutable default argument

 meld/ui/msgarea.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/meld/ui/msgarea.py b/meld/ui/msgarea.py
index 1f5b9fe2..195bd40f 100644
--- a/meld/ui/msgarea.py
+++ b/meld/ui/msgarea.py
@@ -83,13 +83,14 @@ class MsgAreaController(Gtk.HBox):
             self.__msgarea = None
         self.__msgid = None
 
-    def new_from_text_and_icon(self, stockid, primary, secondary=None,
-                               buttons=[]):
+    def new_from_text_and_icon(
+            self, stockid, primary, secondary=None, buttons=None):
         self.clear()
         msgarea = self.__msgarea = Gtk.InfoBar()
 
-        for (text, respid) in buttons:
-            self.add_button(text, respid)
+        if buttons:
+            for (text, respid) in buttons:
+                self.add_button(text, respid)
 
         content = layout_text_and_icon(stockid, primary, secondary)
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]