diff options
| author | Pablo Galindo <Pablogsal@gmail.com> | 2020-05-01 14:18:27 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-01 14:18:27 (GMT) |
| commit | 5055c274c6e4f2bb8025910dedf0ff89f4bdd170 (patch) | |
| tree | 0e8ec7fff9958bd3afcabb38f968fd26eba9dd5f /Include/code.h | |
| parent | 95e208dce505c542b8e4f8f42c57e6d4793b6895 (diff) | |
| download | cpython-5055c274c6e4f2bb8025910dedf0ff89f4bdd170.zip cpython-5055c274c6e4f2bb8025910dedf0ff89f4bdd170.tar.gz cpython-5055c274c6e4f2bb8025910dedf0ff89f4bdd170.tar.bz2 | |
[3.8] bpo-39562: Prevent collision of future and compiler flags (GH-19230) (GH-19835)
The constant values of future flags in the __future__ module
is updated in order to prevent collision with compiler flags.
Previously PyCF_ALLOW_TOP_LEVEL_AWAIT was clashing
with CO_FUTURE_DIVISION..
(cherry picked from commit 4454057269b995341b04d13f0bf97f96080f27d0)
Co-authored-by: Batuhan Taşkaya <batuhanosmantaskaya@gmail.com>
Diffstat (limited to 'Include/code.h')
| -rw-r--r-- | Include/code.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/Include/code.h b/Include/code.h index 3afddd2..a1cd58f 100644 --- a/Include/code.h +++ b/Include/code.h @@ -88,19 +88,19 @@ typedef struct { #define CO_ITERABLE_COROUTINE 0x0100 #define CO_ASYNC_GENERATOR 0x0200 -/* These are no longer used. */ -#if 0 -#define CO_GENERATOR_ALLOWED 0x1000 -#endif -#define CO_FUTURE_DIVISION 0x2000 -#define CO_FUTURE_ABSOLUTE_IMPORT 0x4000 /* do absolute imports by default */ -#define CO_FUTURE_WITH_STATEMENT 0x8000 -#define CO_FUTURE_PRINT_FUNCTION 0x10000 -#define CO_FUTURE_UNICODE_LITERALS 0x20000 - -#define CO_FUTURE_BARRY_AS_BDFL 0x40000 -#define CO_FUTURE_GENERATOR_STOP 0x80000 -#define CO_FUTURE_ANNOTATIONS 0x100000 +/* bpo-39562: These constant values are changed in Python 3.9 + to prevent collision with compiler flags. CO_FUTURE_ and PyCF_ + constants must be kept unique. PyCF_ constants can use bits from + 0x0100 to 0x10000. CO_FUTURE_ constants use bits starting at 0x20000. */ +#define CO_FUTURE_DIVISION 0x20000 +#define CO_FUTURE_ABSOLUTE_IMPORT 0x40000 /* do absolute imports by default */ +#define CO_FUTURE_WITH_STATEMENT 0x80000 +#define CO_FUTURE_PRINT_FUNCTION 0x100000 +#define CO_FUTURE_UNICODE_LITERALS 0x200000 + +#define CO_FUTURE_BARRY_AS_BDFL 0x400000 +#define CO_FUTURE_GENERATOR_STOP 0x800000 +#define CO_FUTURE_ANNOTATIONS 0x1000000 /* This value is found in the co_cell2arg array when the associated cell variable does not correspond to an argument. */ |
