summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/importlib/_bootstrap_external.py3
-rw-r--r--Lib/opcode.py1
-rw-r--r--Lib/test/test_dis.py38
3 files changed, 23 insertions, 19 deletions
diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py
index cf75719..d3f58af 100644
--- a/Lib/importlib/_bootstrap_external.py
+++ b/Lib/importlib/_bootstrap_external.py
@@ -242,6 +242,7 @@ _code_type = type(_write_atomic.__code__)
# Python 3.7a0 3390 (add LOAD_METHOD and CALL_METHOD opcodes)
# Python 3.7a0 3391 (update GET_AITER #31709)
# Python 3.7a0 3392 (PEP 552: Deterministic pycs)
+# Python 3.7a0 3393 (remove STORE_ANNOTATION opcode)
#
# MAGIC must change whenever the bytecode emitted by the compiler may no
# longer be understood by older implementations of the eval loop (usually
@@ -250,7 +251,7 @@ _code_type = type(_write_atomic.__code__)
# Whenever MAGIC_NUMBER is changed, the ranges in the magic_values array
# in PC/launcher.c must also be updated.
-MAGIC_NUMBER = (3392).to_bytes(2, 'little') + b'\r\n'
+MAGIC_NUMBER = (3393).to_bytes(2, 'little') + b'\r\n'
_RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c
_PYCACHE = '__pycache__'
diff --git a/Lib/opcode.py b/Lib/opcode.py
index dffb38c..8f45f0a 100644
--- a/Lib/opcode.py
+++ b/Lib/opcode.py
@@ -169,7 +169,6 @@ def_op('STORE_FAST', 125) # Local variable number
haslocal.append(125)
def_op('DELETE_FAST', 126) # Local variable number
haslocal.append(126)
-name_op('STORE_ANNOTATION', 127) # Index in name list
def_op('RAISE_VARARGS', 130) # Number of raise arguments (1, 2, or 3)
def_op('CALL_FUNCTION', 131) # #args
diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py
index 590f041..ba8c6b9 100644
--- a/Lib/test/test_dis.py
+++ b/Lib/test/test_dis.py
@@ -226,23 +226,27 @@ dis_annot_stmt_str = """\
2 LOAD_CONST 0 (1)
4 STORE_NAME 0 (x)
6 LOAD_NAME 1 (int)
- 8 STORE_ANNOTATION 0 (x)
-
- 3 10 LOAD_NAME 2 (fun)
- 12 LOAD_CONST 0 (1)
- 14 CALL_FUNCTION 1
- 16 STORE_ANNOTATION 3 (y)
-
- 4 18 LOAD_CONST 0 (1)
- 20 LOAD_NAME 4 (lst)
- 22 LOAD_NAME 2 (fun)
- 24 LOAD_CONST 1 (0)
- 26 CALL_FUNCTION 1
- 28 STORE_SUBSCR
- 30 LOAD_NAME 1 (int)
- 32 POP_TOP
- 34 LOAD_CONST 2 (None)
- 36 RETURN_VALUE
+ 8 LOAD_NAME 2 (__annotations__)
+ 10 LOAD_CONST 1 ('x')
+ 12 STORE_SUBSCR
+
+ 3 14 LOAD_NAME 3 (fun)
+ 16 LOAD_CONST 0 (1)
+ 18 CALL_FUNCTION 1
+ 20 LOAD_NAME 2 (__annotations__)
+ 22 LOAD_CONST 2 ('y')
+ 24 STORE_SUBSCR
+
+ 4 26 LOAD_CONST 0 (1)
+ 28 LOAD_NAME 4 (lst)
+ 30 LOAD_NAME 3 (fun)
+ 32 LOAD_CONST 3 (0)
+ 34 CALL_FUNCTION 1
+ 36 STORE_SUBSCR
+ 38 LOAD_NAME 1 (int)
+ 40 POP_TOP
+ 42 LOAD_CONST 4 (None)
+ 44 RETURN_VALUE
"""
compound_stmt_str = """\