largefiles: remove a mutable default argument
authorPierre-Yves David <pierre-yves.david@fb.com>
Thu, 24 Sep 2015 00:48:24 -0700
changeset 26343 019559aa2e80
parent 26342 46bd31fffccb
child 26344 cd9cc7f30427
largefiles: remove a mutable default argument Mutable default arguments are know to the state of California to cause bugs.
hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py	Thu Sep 24 00:48:02 2015 -0700
+++ b/hgext/largefiles/overrides.py	Thu Sep 24 00:48:24 2015 -0700
@@ -728,8 +728,10 @@
 
         oldstandins = lfutil.getstandinsstate(repo)
 
-        def overridematch(mctx, pats=(), opts={}, globbed=False,
+        def overridematch(mctx, pats=(), opts=None, globbed=False,
                 default='relpath', badfn=None):
+            if opts is None:
+                opts = {}
             match = oldmatch(mctx, pats, opts, globbed, default, badfn=badfn)
             m = copy.copy(match)