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

Skip to content

Commit 466a782

Browse files
committed
the old CO_FUTURE flags can't be commented out
1 parent c963731 commit 466a782

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

Include/code.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,13 @@ typedef struct {
4242
*/
4343
#define CO_NOFREE 0x0040
4444

45-
#if 0
4645
/* These are no longer used. */
4746
#define CO_GENERATOR_ALLOWED 0x1000
4847
#define CO_FUTURE_DIVISION 0x2000
4948
#define CO_FUTURE_ABSOLUTE_IMPORT 0x4000 /* do absolute imports by default */
5049
#define CO_FUTURE_WITH_STATEMENT 0x8000
5150
#define CO_FUTURE_PRINT_FUNCTION 0x10000
5251
#define CO_FUTURE_UNICODE_LITERALS 0x20000
53-
#endif
5452

5553
#define CO_FUTURE_BARRY_AS_BDFL 0x40000
5654

Include/pythonrun.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
extern "C" {
88
#endif
99

10-
#define PyCF_MASK CO_FUTURE_BARRY_AS_BDFL
10+
#define PyCF_MASK (CO_FUTURE_DIVISION | CO_FUTURE_ABSOLUTE_IMPORT | \
11+
CO_FUTURE_WITH_STATEMENT | CO_FUTURE_PRINT_FUNCTION | \
12+
CO_FUTURE_UNICODE_LITERALS | CO_FUTURE_BARRY_AS_BDFL)
1113
#define PyCF_MASK_OBSOLETE 0
1214
#define PyCF_SOURCE_IS_UTF8 0x0100
1315
#define PyCF_DONT_IMPLY_DEDENT 0x0200

Misc/NEWS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ Core and Builtins
2424

2525
- Issue #4856: Remove checks for win NT.
2626

27+
C-API
28+
-----
29+
30+
- The code flags for old __future__ features are now available again.
31+
2732
Library
2833
-------
2934

0 commit comments

Comments
 (0)