# HG changeset patch # User Connor Sheehan # Date 1568133127 14400 # Node ID 8d9322b6e6875b83f2e50ea4c4d2174c6c830e30 # Parent 4690902850df0e165be87d4846ea13f5b78035c5 hgweb: add a `message` attribute to `hgweb.common.ErrorResponse` This fixes a Python 3 bug where hgweb assumes an Exception subclass will have a `.message` attribute after running `Exception.__init__`.[1] The Python 3 way to get this info would be `e.args[0]`, but adding a new named attribute is more ergonomic in my view. [1] https://www.mercurial-scm.org/repo/hg-committed/file/6ccf539aec71/mercurial/hgweb/hgwebdir_mod.py#l459 Differential Revision: https://phab.mercurial-scm.org/D6840 diff -r 4690902850df -r 8d9322b6e687 mercurial/hgweb/common.py --- a/mercurial/hgweb/common.py Tue Sep 10 22:52:04 2019 -0400 +++ b/mercurial/hgweb/common.py Tue Sep 10 12:32:07 2019 -0400 @@ -106,6 +106,7 @@ if headers is None: headers = [] self.headers = headers + self.message = message class continuereader(object): """File object wrapper to handle HTTP 100-continue.