diff mercurial/hgweb/common.py @ 31399:7dafa8d0e006

hgweb: don't use mutable default argument value
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 26 Dec 2016 16:55:47 -0700
parents d7bf7d2bd5ab
children 2daeab02b4b1
line wrap: on
line diff
--- 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):