[Python-checkins] cpython (merge 3.5 -> default): Issue #26073: Updates magic number comment in _bootstrap_external.py and
steve.dower
python-checkins at python.org
Mon May 16 12:41:21 EDT 2016
https://hg.python.org/cpython/rev/0fe913de4702
changeset: 101374:0fe913de4702
parent: 101372:841a9a3f3cf6
parent: 101373:d921932fe02f
user: Steve Dower <steve.dower at microsoft.com>
date: Mon May 16 09:35:18 2016 -0700
summary:
Issue #26073: Updates magic number comment in _bootstrap_external.py and changes numbers in launcher.py to decimal to match official table.
files:
Lib/importlib/_bootstrap_external.py | 3 +
PC/launcher.c | 30 ++++++++--------
2 files changed, 18 insertions(+), 15 deletions(-)
diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py
--- a/Lib/importlib/_bootstrap_external.py
+++ b/Lib/importlib/_bootstrap_external.py
@@ -229,6 +229,9 @@
# MAGIC must change whenever the bytecode emitted by the compiler may no
# longer be understood by older implementations of the eval loop (usually
# due to the addition of new opcodes).
+#
+# Whenever MAGIC_NUMBER is changed, the ranges in the magic_values array
+# in PC/launcher.c must also be updated.
MAGIC_NUMBER = (3361).to_bytes(2, 'little') + b'\r\n'
_RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c
diff --git a/PC/launcher.c b/PC/launcher.c
--- a/PC/launcher.c
+++ b/PC/launcher.c
@@ -1068,21 +1068,21 @@
} PYC_MAGIC;
static PYC_MAGIC magic_values[] = {
- { 0xc687, 0xc687, L"2.0" },
- { 0xeb2a, 0xeb2a, L"2.1" },
- { 0xed2d, 0xed2d, L"2.2" },
- { 0xf23b, 0xf245, L"2.3" },
- { 0xf259, 0xf26d, L"2.4" },
- { 0xf277, 0xf2b3, L"2.5" },
- { 0xf2c7, 0xf2d1, L"2.6" },
- { 0xf2db, 0xf303, L"2.7" },
- { 0x0bb8, 0x0c3b, L"3.0" },
- { 0x0c45, 0x0c4f, L"3.1" },
- { 0x0c58, 0x0c6c, L"3.2" },
- { 0x0c76, 0x0c9e, L"3.3" },
- { 0x0cb2, 0x0cee, L"3.4" },
- { 0x0cf8, 0x0d16, L"3.5" },
- { 0x0d20, 0x0d20, L"3.6" },
+ { 50823, 50823, L"2.0" },
+ { 60202, 60202, L"2.1" },
+ { 60717, 60717, L"2.2" },
+ { 62011, 62021, L"2.3" },
+ { 62041, 62061, L"2.4" },
+ { 62071, 62131, L"2.5" },
+ { 62151, 62161, L"2.6" },
+ { 62171, 62211, L"2.7" },
+ { 3000, 3131, L"3.0" },
+ { 3141, 3151, L"3.1" },
+ { 3160, 3180, L"3.2" },
+ { 3190, 3230, L"3.3" },
+ { 3250, 3310, L"3.4" },
+ { 3320, 3350, L"3.5" },
+ { 3350, 3350, L"3.6" },
{ 0 }
};
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list