hgweb: import wsgicgi at top level
authorYuya Nishihara <yuya@tcha.org>
Sun, 01 Nov 2015 15:09:35 +0900
changeset 27045 eac72c1e1e0d
parent 27044 1dde4914fb6c
child 27046 37fcfe52c68c
hgweb: import wsgicgi at top level There should be no practical reason to delay the import of wsgicgi.
mercurial/hgweb/hgweb_mod.py
mercurial/hgweb/hgwebdir_mod.py
--- a/mercurial/hgweb/hgweb_mod.py	Sun Nov 01 15:07:08 2015 +0900
+++ b/mercurial/hgweb/hgweb_mod.py	Sun Nov 01 15:09:35 2015 +0900
@@ -15,7 +15,7 @@
 from common import HTTP_OK, HTTP_NOT_MODIFIED, HTTP_BAD_REQUEST
 from common import HTTP_NOT_FOUND, HTTP_SERVER_ERROR
 from request import wsgirequest
-import webcommands, protocol, webutil
+import webcommands, protocol, webutil, wsgicgi
 
 perms = {
     'changegroup': 'pull',
@@ -261,7 +261,6 @@
         if not os.environ.get('GATEWAY_INTERFACE', '').startswith("CGI/1."):
             raise RuntimeError("This function is only intended to be "
                                "called while running as a CGI script.")
-        import mercurial.hgweb.wsgicgi as wsgicgi
         wsgicgi.launch(self)
 
     def __call__(self, env, respond):
--- a/mercurial/hgweb/hgwebdir_mod.py	Sun Nov 01 15:07:08 2015 +0900
+++ b/mercurial/hgweb/hgwebdir_mod.py	Sun Nov 01 15:09:35 2015 +0900
@@ -15,7 +15,7 @@
                    get_contact, HTTP_OK, HTTP_NOT_FOUND, HTTP_SERVER_ERROR
 import hgweb_mod
 from request import wsgirequest
-import webutil
+import webutil, wsgicgi
 
 def cleannames(items):
     return [(util.pconvert(name).strip('/'), path) for name, path in items]
@@ -162,7 +162,6 @@
         if not os.environ.get('GATEWAY_INTERFACE', '').startswith("CGI/1."):
             raise RuntimeError("This function is only intended to be "
                                "called while running as a CGI script.")
-        import mercurial.hgweb.wsgicgi as wsgicgi
         wsgicgi.launch(self)
 
     def __call__(self, env, respond):