# HG changeset patch # User Gregory Szorc # Date 2022-02-21 17:47:08 # Node ID e453c69821f83ddea295c399b279af28d23f1627 # Parent 7eebe5630bcc15d5555c482327fe8d8357545718 hgweb: remove Python 2 support code Differential Revision: https://phab.mercurial-scm.org/D12309 diff --git a/mercurial/hgweb/server.py b/mercurial/hgweb/server.py --- a/mercurial/hgweb/server.py +++ b/mercurial/hgweb/server.py @@ -185,18 +185,11 @@ class _httprequesthandler(httpservermod. env['REMOTE_ADDR'] = self.client_address[0] env['QUERY_STRING'] = query or '' - if pycompat.ispy3: - if self.headers.get_content_type() is None: - env['CONTENT_TYPE'] = self.headers.get_default_type() - else: - env['CONTENT_TYPE'] = self.headers.get_content_type() - length = self.headers.get('content-length') + if self.headers.get_content_type() is None: + env['CONTENT_TYPE'] = self.headers.get_default_type() else: - if self.headers.typeheader is None: - env['CONTENT_TYPE'] = self.headers.type - else: - env['CONTENT_TYPE'] = self.headers.typeheader - length = self.headers.getheader('content-length') + env['CONTENT_TYPE'] = self.headers.get_content_type() + length = self.headers.get('content-length') if length: env['CONTENT_LENGTH'] = length for header in [