diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py +++ b/mercurial/hgweb/hgweb_mod.py @@ -275,7 +275,8 @@ class hgweb(object): should be using instances of this class as the WSGI application. """ with self._obtainrepo() as repo: - return self._runwsgi(req, repo) + for r in self._runwsgi(req, repo): + yield r def _runwsgi(self, req, repo): rctx = requestcontext(self, repo) diff --git a/tests/test-hgweb-non-interactive.t b/tests/test-hgweb-non-interactive.t --- a/tests/test-hgweb-non-interactive.t +++ b/tests/test-hgweb-non-interactive.t @@ -58,7 +58,8 @@ by the WSGI standard and strictly implem > } > > i = hgweb('.') - > i(env, startrsp) + > for c in i(env, startrsp): + > pass > print '---- ERRORS' > print errors.getvalue() > print '---- OS.ENVIRON wsgi variables'