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)