changeset 31444:2daeab02b4b1

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
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Wed, 15 Mar 2017 15:11:04 -0700
parents d4645ae6ba15
children ac7aa96e4cd8
files mercurial/hgweb/common.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/common.py	Wed Mar 15 15:10:09 2017 -0700
+++ b/mercurial/hgweb/common.py	Wed Mar 15 15:11:04 2017 -0700
@@ -96,7 +96,9 @@
             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):