Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eaed39f

Browse files
committed
Hopefully this removes all vestiges of CO_GENERATOR_ALLOWED that can
be removed in 2.x.
1 parent fa0cf4f commit eaed39f

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

Lib/compiler/consts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
CO_VARKEYWORDS = 0x0008
1616
CO_NESTED = 0x0010
1717
CO_GENERATOR = 0x0020
18-
CO_GENERATOR_ALLOWED = 0x1000
18+
CO_GENERATOR_ALLOWED = 0
1919
CO_FUTURE_DIVISION = 0x2000
2020
CO_FUTURE_ABSIMPORT = 0x4000
2121
CO_FUTURE_WITH_STATEMENT = 0x8000

Lib/compiler/pycodegen.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from compiler import pyassem, misc, future, symbols
1010
from compiler.consts import SC_LOCAL, SC_GLOBAL, SC_FREE, SC_CELL
1111
from compiler.consts import (CO_VARARGS, CO_VARKEYWORDS, CO_NEWLOCALS,
12-
CO_NESTED, CO_GENERATOR, CO_GENERATOR_ALLOWED, CO_FUTURE_DIVISION,
12+
CO_NESTED, CO_GENERATOR, CO_FUTURE_DIVISION,
1313
CO_FUTURE_ABSIMPORT, CO_FUTURE_WITH_STATEMENT)
1414
from compiler.pyassem import TupleArg
1515

@@ -214,8 +214,6 @@ def __init__(self):
214214
if feature == "division":
215215
self.graph.setFlag(CO_FUTURE_DIVISION)
216216
self._div_op = "BINARY_TRUE_DIVIDE"
217-
elif feature == "generators":
218-
self.graph.setFlag(CO_GENERATOR_ALLOWED)
219217
elif feature == "absolute_import":
220218
self.graph.setFlag(CO_FUTURE_ABSIMPORT)
221219
elif feature == "with_statement":

0 commit comments

Comments
 (0)