mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
utilize yield from
This commit is contained in:
parent
075bbb176f
commit
4993cc0a5b
11 changed files with 18 additions and 36 deletions
|
@ -132,8 +132,7 @@ def _iter_chain(exc, custom_tb=None, seen=None):
|
|||
its.append([(exc, custom_tb or exc.__traceback__)])
|
||||
# itertools.chain is in an extension module and may be unavailable
|
||||
for it in its:
|
||||
for x in it:
|
||||
yield x
|
||||
yield from it
|
||||
|
||||
|
||||
def print_exception(etype, value, tb, limit=None, file=None, chain=True):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue