From 8b915ae67ae66b8f8a8c2a79f5ed65b4e3d0a7b9 Mon Sep 17 00:00:00 2001 From: xoviat Date: Sun, 4 Apr 2021 16:25:43 -0500 Subject: [PATCH] modulegraph: implement 'yield from' --- PyInstaller/lib/modulegraph/util.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/PyInstaller/lib/modulegraph/util.py b/PyInstaller/lib/modulegraph/util.py index fe087777f62..7c742da7b4d 100644 --- a/PyInstaller/lib/modulegraph/util.py +++ b/PyInstaller/lib/modulegraph/util.py @@ -136,10 +136,7 @@ def iterate_instructions(code_object): Yields `dis.Instruction`. After each code-block (`co_code`), `None` is yielded to mark the end of the block and to interrupt the steam. """ - # TODO: Implement "yield from" for python 3 - - for instruction in get_instructions(code_object): - yield instruction + yield from get_instructions(code_object) yield None @@ -147,5 +144,4 @@ def iterate_instructions(code_object): # parse this constant in the same manner. for constant in code_object.co_consts: if inspect.iscode(constant): - for instruction in iterate_instructions(constant): - yield instruction + yield from iterate_instructions(constant)