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

Skip to content

Commit 2bbdba3

Browse files
committed
Removed more hair in support of future-generator stmts.
1 parent 68c7e26 commit 2bbdba3

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

Include/compile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ typedef struct {
4040
compiled *by* a code object knows whether to allow yield stmts. In
4141
effect, this passes on the "from __future__ import generators" state
4242
in effect when the code block was compiled. */
43-
#define CO_GENERATOR_ALLOWED 0x1000
43+
#define CO_GENERATOR_ALLOWED 0x1000 /* no longer used in an essential way */
4444
#define CO_FUTURE_DIVISION 0x2000
4545

4646
extern DL_IMPORT(PyTypeObject) PyCode_Type;

Include/pythonrun.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
extern "C" {
88
#endif
99

10-
#define PyCF_MASK (CO_GENERATOR_ALLOWED | CO_FUTURE_DIVISION)
11-
#define PyCF_MASK_OBSOLETE (CO_NESTED)
10+
#define PyCF_MASK (CO_FUTURE_DIVISION)
11+
#define PyCF_MASK_OBSOLETE (CO_GENERATOR_ALLOWED | CO_NESTED)
1212

1313
typedef struct {
1414
int cf_flags; /* bitmask of CO_xxx flags relevant to future */

Python/future.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ future_check_features(PyFutureFeatures *ff, node *n, char *filename)
3535
if (strcmp(feature, FUTURE_NESTED_SCOPES) == 0) {
3636
continue;
3737
} else if (strcmp(feature, FUTURE_GENERATORS) == 0) {
38-
ff->ff_features |= CO_GENERATOR_ALLOWED;
38+
continue;
3939
} else if (strcmp(feature, FUTURE_DIVISION) == 0) {
4040
ff->ff_features |= CO_FUTURE_DIVISION;
4141
} else if (strcmp(feature, "braces") == 0) {

0 commit comments

Comments
 (0)