hgweb: remove Python 2 support code
authorGregory Szorc <gregory.szorc@gmail.com>
Mon, 21 Feb 2022 10:47:08 -0700
changeset 48906 e453c69821f8
parent 48905 7eebe5630bcc
child 48907 b677bccf74b9
hgweb: remove Python 2 support code Differential Revision: https://phab.mercurial-scm.org/D12309
mercurial/hgweb/server.py
--- a/mercurial/hgweb/server.py	Thu Mar 03 08:06:37 2022 -0800
+++ b/mercurial/hgweb/server.py	Mon Feb 21 10:47:08 2022 -0700
@@ -185,18 +185,11 @@
         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 [