changeset 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 758526333dec
children d2878bec55bd
files mercurial/hgweb/common.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
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):