diff -r 98487ad0cf8b -r f0a851542a05 mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py Sat Mar 10 15:24:24 2018 +0530 +++ b/mercurial/hgweb/hgweb_mod.py Sun Mar 11 16:29:54 2018 -0700 @@ -290,10 +290,12 @@ This may be called by multiple threads. """ - req = requestmod.wsgirequest(env, respond) - return self.run_wsgi(req) + req = requestmod.parserequestfromenv(env) + res = requestmod.wsgiresponse(req, respond) - def run_wsgi(self, wsgireq): + return self.run_wsgi(req, res) + + def run_wsgi(self, req, res): """Internal method to run the WSGI application. This is typically only called by Mercurial. External consumers @@ -302,12 +304,10 @@ with self._obtainrepo() as repo: profile = repo.ui.configbool('profiling', 'enabled') with profiling.profile(repo.ui, enabled=profile): - for r in self._runwsgi(wsgireq, repo): + for r in self._runwsgi(req, res, repo): yield r - def _runwsgi(self, wsgireq, repo): - req = wsgireq.req - res = wsgireq.res + def _runwsgi(self, req, res, repo): rctx = requestcontext(self, repo, req, res) # This state is global across all threads.