aboutsummaryrefslogtreecommitdiff
path: root/tests/cmdline/cmd_showbc.py.exp
diff options
context:
space:
mode:
authorPetr Viktorin2019-09-20 09:16:34 +0200
committerDamien George2019-10-04 16:46:47 +1000
commit25a9bccdee2fe830046c1c1a0220ca7706597202 (patch)
tree69e2b808f5f523964dd4d71257dc4e9e60f309c4 /tests/cmdline/cmd_showbc.py.exp
parent26e90a051415629796efbec59f1d653b46e43aea (diff)
py/compile: Disallow 'import *' outside module level.
This check follows CPython's behaviour, because 'import *' always populates the globals with the imported names, not locals. Since it's safe to do this (doesn't lead to a crash or undefined behaviour) the check is only enabled for MICROPY_CPYTHON_COMPAT. Fixes issue #5121.
Diffstat (limited to 'tests/cmdline/cmd_showbc.py.exp')
-rw-r--r--tests/cmdline/cmd_showbc.py.exp12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/cmdline/cmd_showbc.py.exp b/tests/cmdline/cmd_showbc.py.exp
index b0a9016c5..4d90ae22c 100644
--- a/tests/cmdline/cmd_showbc.py.exp
+++ b/tests/cmdline/cmd_showbc.py.exp
@@ -7,7 +7,7 @@ arg names:
(N_EXC_STACK 0)
bc=0 line=1
########
- bc=\\d\+ line=155
+ bc=\\d\+ line=159
00 MAKE_FUNCTION \.\+
\\d\+ STORE_NAME f
\\d\+ MAKE_FUNCTION \.\+
@@ -27,6 +27,11 @@ arg names:
\\d\+ DELETE_NAME Class
\\d\+ MAKE_FUNCTION \.\+
\\d\+ STORE_NAME f
+\\d\+ LOAD_CONST_SMALL_INT 0
+\\d\+ LOAD_CONST_STRING '*'
+\\d\+ BUILD_TUPLE 1
+\\d\+ IMPORT_NAME 'sys'
+\\d\+ IMPORT_STAR
\\d\+ LOAD_CONST_NONE
\\d\+ RETURN_VALUE
File cmdline/cmd_showbc.py, code block 'f' (descriptor: \.\+, bytecode @\.\+ bytes)
@@ -300,11 +305,6 @@ Raw bytecode (code_info_size=\\d\+, bytecode_size=\\d\+):
\\d\+ IMPORT_FROM 'b'
\\d\+ STORE_DEREF 14
\\d\+ POP_TOP
-\\d\+ LOAD_CONST_SMALL_INT 0
-\\d\+ LOAD_CONST_STRING '*'
-\\d\+ BUILD_TUPLE 1
-\\d\+ IMPORT_NAME 'a'
-\\d\+ IMPORT_STAR
\\d\+ RAISE_LAST
\\d\+ LOAD_CONST_SMALL_INT 1
\\d\+ RAISE_OBJ