comparison mercurial/hgweb/hgweb_mod.py @ 52669:e627cc25b6f3

pyupgrade: rewrite `yield` statements in a loop to `yield from` This is the `legacy` fixer in `pyupgrade`, with the `yield` statement yielding loop commented back in. This seems to help pytype in some cases, and hurt it in others. But that can be manually fixed later. Note that it's possibly buggy in that it aggressively changed `import-checker.py` to `yield from 'fcntl', 'grp', 'pwd', 'select', 'termios': # Unix only`, which is invalid syntax. Possibly it needed help from the token fixer that I've disabled locally (because that wants to make a bunch of unrelated changes). Just change those few places to yield from a list, to avoid having to constantly revert that.
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 05 Jan 2025 22:26:16 -0500
parents f4733654f144
children
comparison
equal deleted inserted replaced
52668:5cc8deb96b48 52669:e627cc25b6f3
359 should be using instances of this class as the WSGI application. 359 should be using instances of this class as the WSGI application.
360 """ 360 """
361 with self._obtainrepo() as repo: 361 with self._obtainrepo() as repo:
362 profile = repo.ui.configbool(b'profiling', b'enabled') 362 profile = repo.ui.configbool(b'profiling', b'enabled')
363 with profiling.profile(repo.ui, enabled=profile): 363 with profiling.profile(repo.ui, enabled=profile):
364 for r in self._runwsgi(req, res, repo): 364 yield from self._runwsgi(req, res, repo)
365 yield r
366 365
367 def _runwsgi(self, req, res, repo): 366 def _runwsgi(self, req, res, repo):
368 rctx = requestcontext(self, repo, req, res) 367 rctx = requestcontext(self, repo, req, res)
369 368
370 # This state is global across all threads. 369 # This state is global across all threads.