hgweb: don't use mutable default argument value
authorGregory Szorc <gregory.szorc@gmail.com>
Mon, 26 Dec 2016 16:55:47 -0700
changeset 31390 7dafa8d0e006
parent 31389 758526333dec
child 31391 d2878bec55bd
hgweb: don't use mutable default argument value
mercurial/hgweb/common.py
--- a/mercurial/hgweb/common.py	Mon Dec 26 16:54:33 2016 -0700
+++ b/mercurial/hgweb/common.py	Mon Dec 26 16:55:47 2016 -0700
@@ -91,12 +91,12 @@
 
 
 class ErrorResponse(Exception):
-    def __init__(self, code, message=None, headers=[]):
+    def __init__(self, code, message=None, headers=None):
         if message is None:
             message = _statusmessage(code)
         Exception.__init__(self, message)
         self.code = code
-        self.headers = headers
+        self.headers = headers or []
 
 class continuereader(object):
     def __init__(self, f, write):