exthelper: avoid a [] default arg to wrapcommand()
authorMatt Harbison <matt_harbison@yahoo.com>
Thu, 27 Dec 2018 21:26:17 -0500
changeset 4325 7f3c25791fe2
parent 4324 e913546b9d79
child 4326 80fce30fd919
exthelper: avoid a [] default arg to wrapcommand()
hgext3rd/evolve/exthelper.py
--- a/hgext3rd/evolve/exthelper.py	Fri Jan 04 00:10:44 2019 -0500
+++ b/hgext3rd/evolve/exthelper.py	Thu Dec 27 21:26:17 2018 -0500
@@ -281,7 +281,7 @@
             return keyword
         return dec
 
-    def wrapcommand(self, command, extension=None, opts=[]):
+    def wrapcommand(self, command, extension=None, opts=None):
         """Decorated function is a command wrapper
 
         The name of the command must be given as the decorator argument.
@@ -304,6 +304,8 @@
         command.
 
         """
+        if opts is None:
+            opts = []
         def dec(wrapper):
             if extension is None:
                 self._commandwrappers.append((command, wrapper, opts))