From 839eb6fe0bef81b79862b983f42b0edf037a4f3a Mon Sep 17 00:00:00 2001 From: rocky Date: Mon, 6 Jan 2020 15:02:40 -0500 Subject: [PATCH] bogus "yield" insertion not needed in 2.x --- uncompyle6/semantics/make_function2.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/uncompyle6/semantics/make_function2.py b/uncompyle6/semantics/make_function2.py index 0e53ff45..d1ab3791 100644 --- a/uncompyle6/semantics/make_function2.py +++ b/uncompyle6/semantics/make_function2.py @@ -204,20 +204,5 @@ def make_function2(self, node, is_lambda, nested=1, code_node=None): ast, code.co_name, code._customize, is_lambda=is_lambda, returnNone=rn ) - # In obscure cases, a function may be a generator but the "yield" - # was optimized away. Here, we need to put in unreachable code to - # add in "yield" just so that the compiler will mark - # the GENERATOR bit of the function. See for example - # Python 3.x's test_generator.py test program. - if code.co_flags & CO_GENERATOR: - need_bogus_yield = True - for token in scanner_code._tokens: - if token == "YIELD_VALUE": - need_bogus_yield = False - break - pass - if need_bogus_yield: - self.template_engine(("%|if False:\n%+%|yield None%-",), node) - code._tokens = None # save memory code._customize = None # save memory