comparison mercurial/ui.py @ 52644: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 24ee91ba9aa8
children 4cb75772818d
comparison
equal deleted inserted replaced
52643:5cc8deb96b48 52644:e627cc25b6f3
978 return items 978 return items
979 979
980 def walkconfig(self, untrusted=False, all_known=False): 980 def walkconfig(self, untrusted=False, all_known=False):
981 defined = self._walk_config(untrusted) 981 defined = self._walk_config(untrusted)
982 if not all_known: 982 if not all_known:
983 for d in defined: 983 yield from defined
984 yield d
985 return 984 return
986 known = self._walk_known() 985 known = self._walk_known()
987 current_defined = next(defined, None) 986 current_defined = next(defined, None)
988 current_known = next(known, None) 987 current_known = next(known, None)
989 while current_defined is not None or current_known is not None: 988 while current_defined is not None or current_known is not None: