[PATCH 1 of 7 evolve-ext] exthelper: avoid a [] default arg to wrapcommand()

Matt Harbison mharbison72 at gmail.com
Thu Jan 3 05:30:48 UTC 2019


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1545963977 18000
#      Thu Dec 27 21:26:17 2018 -0500
# Node ID f208ece681e49dca806e2a30322b1126aeb847d1
# Parent  482992803db6419bae6f6ee68fb3ee03a3eb2289
exthelper: avoid a [] default arg to wrapcommand()

diff --git a/hgext3rd/evolve/exthelper.py b/hgext3rd/evolve/exthelper.py
--- a/hgext3rd/evolve/exthelper.py
+++ b/hgext3rd/evolve/exthelper.py
@@ -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))


More information about the Mercurial-devel mailing list