mercurial/hgweb/wsgicgi.py
changeset 43076 2372284d9457
parent 37747 2d5b5bcc3b9f
child 43077 687b865b95ad
--- a/mercurial/hgweb/wsgicgi.py	Sat Oct 05 10:29:34 2019 -0400
+++ b/mercurial/hgweb/wsgicgi.py	Sun Oct 06 09:45:02 2019 -0400
@@ -12,29 +12,24 @@
 
 import os
 
-from .. import (
-    pycompat,
-)
+from .. import pycompat
 
-from ..utils import (
-    procutil,
-)
+from ..utils import procutil
 
-from . import (
-    common,
-)
+from . import common
+
 
 def launch(application):
     procutil.setbinary(procutil.stdin)
     procutil.setbinary(procutil.stdout)
 
-    environ = dict(os.environ.iteritems()) # re-exports
+    environ = dict(os.environ.iteritems())  # re-exports
     environ.setdefault(r'PATH_INFO', '')
     if environ.get(r'SERVER_SOFTWARE', r'').startswith(r'Microsoft-IIS'):
         # IIS includes script_name in PATH_INFO
         scriptname = environ[r'SCRIPT_NAME']
         if environ[r'PATH_INFO'].startswith(scriptname):
-            environ[r'PATH_INFO'] = environ[r'PATH_INFO'][len(scriptname):]
+            environ[r'PATH_INFO'] = environ[r'PATH_INFO'][len(scriptname) :]
 
     stdin = procutil.stdin
     if environ.get(r'HTTP_EXPECT', r'').lower() == r'100-continue':
@@ -65,8 +60,10 @@
             status, response_headers = headers_sent[:] = headers_set
             out.write('Status: %s\r\n' % pycompat.bytesurl(status))
             for hk, hv in response_headers:
-                out.write('%s: %s\r\n' % (pycompat.bytesurl(hk),
-                                          pycompat.bytesurl(hv)))
+                out.write(
+                    '%s: %s\r\n'
+                    % (pycompat.bytesurl(hk), pycompat.bytesurl(hv))
+                )
             out.write('\r\n')
 
         out.write(data)
@@ -79,7 +76,7 @@
                     # Re-raise original exception if headers sent
                     raise exc_info[0](exc_info[1], exc_info[2])
             finally:
-                exc_info = None     # avoid dangling circular ref
+                exc_info = None  # avoid dangling circular ref
         elif headers_set:
             raise AssertionError("Headers already set!")
 
@@ -91,6 +88,6 @@
         for chunk in content:
             write(chunk)
         if not headers_sent:
-            write('')   # send headers now if body was empty
+            write('')  # send headers now if body was empty
     finally:
         getattr(content, 'close', lambda: None)()