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

login
register
mail settings
Submitter Matt Harbison
Date Jan. 3, 2019, 5:30 a.m.
Message ID <f208ece681e49dca806e.1546493448@Envy>
Download mbox | patch
Permalink /patch/37433/
State Accepted
Headers show

Comments

Matt Harbison - Jan. 3, 2019, 5:30 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@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()

Patch

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))