diff options
| author | Georg Brandl <georg@python.org> | 2020-09-06 14:35:14 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-06 14:35:14 +0200 |
| commit | 40baa94a6bf0c62be8c8b03a942116869ce80128 (patch) | |
| tree | 50eca3f33e60a4bbadd29bf566b294052e509259 /pygments/lexers/python.py | |
| parent | ed93a2758bdfbeaafc43ac59a611bf2cff92b55c (diff) | |
| download | pygments-git-40baa94a6bf0c62be8c8b03a942116869ce80128.tar.gz | |
all: use yield from (#1537)
Diffstat (limited to 'pygments/lexers/python.py')
| -rw-r--r-- | pygments/lexers/python.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/pygments/lexers/python.py b/pygments/lexers/python.py index ba037eb3..22d21430 100644 --- a/pygments/lexers/python.py +++ b/pygments/lexers/python.py @@ -660,9 +660,8 @@ class PythonConsoleLexer(Lexer): curcode += line[3:] else: if curcode: - for item in do_insertions( - insertions, pylexer.get_tokens_unprocessed(curcode)): - yield item + yield from do_insertions( + insertions, pylexer.get_tokens_unprocessed(curcode)) curcode = '' insertions = [] if (line.startswith(u'Traceback (most recent call last):') or @@ -682,9 +681,8 @@ class PythonConsoleLexer(Lexer): else: yield match.start(), Generic.Output, line if curcode: - for item in do_insertions(insertions, - pylexer.get_tokens_unprocessed(curcode)): - yield item + yield from do_insertions(insertions, + pylexer.get_tokens_unprocessed(curcode)) if curtb: for i, t, v in tblexer.get_tokens_unprocessed(curtb): yield tbindex+i, t, v |
