summaryrefslogtreecommitdiffstats
path: root/Lib/importlib/_bootstrap_external.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-01-20 11:16:21 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-01-20 11:16:21 (GMT)
commitf3914eb16d28ad9eb20fe5133d9aa83658bcc27f (patch)
tree65316948bcac4a6bf79e8b3791de51f11a163432 /Lib/importlib/_bootstrap_external.py
parent316fcc867bbae652272aefb726185c12907ba8d4 (diff)
downloadcpython-f3914eb16d28ad9eb20fe5133d9aa83658bcc27f.zip
cpython-f3914eb16d28ad9eb20fe5133d9aa83658bcc27f.tar.gz
cpython-f3914eb16d28ad9eb20fe5133d9aa83658bcc27f.tar.bz2
co_lnotab supports negative line number delta
Issue #26107: The format of the co_lnotab attribute of code objects changes to support negative line number delta. Changes: * assemble_lnotab(): if line number delta is less than -128 or greater than 127, emit multiple (offset_delta, lineno_delta) in co_lnotab * update functions decoding co_lnotab to use signed 8-bit integers - dis.findlinestarts() - PyCode_Addr2Line() - _PyCode_CheckLineNumber() - frame_setlineno() * update lnotab_notes.txt * increase importlib MAGIC_NUMBER to 3361 * document the change in What's New in Python 3.6 * cleanup also PyCode_Optimize() to use better variable names
Diffstat (limited to 'Lib/importlib/_bootstrap_external.py')
-rw-r--r--Lib/importlib/_bootstrap_external.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py
index f274501..71098f1 100644
--- a/Lib/importlib/_bootstrap_external.py
+++ b/Lib/importlib/_bootstrap_external.py
@@ -223,13 +223,14 @@ _code_type = type(_write_atomic.__code__)
# Python 3.5b1 3330 (PEP 448: Additional Unpacking Generalizations)
# Python 3.5b2 3340 (fix dictionary display evaluation order #11205)
# Python 3.5b2 3350 (add GET_YIELD_FROM_ITER opcode #24400)
-# Python 3.6a0 3360 (add FORMAT_VALUE opcode #25483)
+# Python 3.6a0 3360 (add FORMAT_VALUE opcode #25483
+# Python 3.6a0 3361 (lineno delta of code.co_lnotab becomes signed)
#
# 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).
-MAGIC_NUMBER = (3360).to_bytes(2, 'little') + b'\r\n'
+MAGIC_NUMBER = (3361).to_bytes(2, 'little') + b'\r\n'
_RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c
_PYCACHE = '__pycache__'