# HG changeset patch # User Pierre-Yves David # Date 2017-03-15 22:11:04 # Node ID 2daeab02b4b13b4d4829c216fd0db39e9733ba0b # Parent d4645ae6ba1592a2dc6bc2e82036dd4d090b3a49 hgweb: explicitly tests for None Changeset 7dafa8d0e006 removed the mutable default value, but did not explicitly tested for None. Such implicit testing can introduce semantic and performance issue. We move to an explicit testing for None as recommended by PEP8: https://www.python.org/dev/peps/pep-0008/#programming-recommendations diff --git a/mercurial/hgweb/common.py b/mercurial/hgweb/common.py --- a/mercurial/hgweb/common.py +++ b/mercurial/hgweb/common.py @@ -96,7 +96,9 @@ class ErrorResponse(Exception): message = _statusmessage(code) Exception.__init__(self, message) self.code = code - self.headers = headers or [] + if headers is None: + headers = [] + self.headers = headers class continuereader(object): def __init__(self, f, write):