Skip to content

Commit 195e532

Browse files
committed
Fix test_dis.py
1 parent c3276da commit 195e532

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Lib/test/test_dis.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -205,20 +205,20 @@ def bug42562():
205205
206206
"""
207207

208-
expr_str = "x + 1"
208+
expr_str = "x + 1000000"
209209

210210
dis_expr_str = """\
211211
1 0 LOAD_NAME 0 (x)
212-
2 LOAD_CONST 0 (1)
212+
2 LOAD_CONST 0 (1000000)
213213
4 BINARY_ADD
214214
6 RETURN_VALUE
215215
"""
216216

217-
simple_stmt_str = "x = x + 1"
217+
simple_stmt_str = "x = x + 1000000"
218218

219219
dis_simple_stmt_str = """\
220220
1 0 LOAD_NAME 0 (x)
221-
2 LOAD_CONST 0 (1)
221+
2 LOAD_CONST 0 (1000000)
222222
4 BINARY_ADD
223223
6 STORE_NAME 0 (x)
224224
8 LOAD_CONST 1 (None)
@@ -559,14 +559,14 @@ def func(count):
559559
def test_big_offsets(self):
560560
def func(count):
561561
namespace = {}
562-
func = "def foo(x):\n " + ";".join(["x = x + 1"] * count) + "\n return x"
562+
func = "def foo(x):\n " + ";".join(["x = x + 1000000"] * count) + "\n return x"
563563
exec(func, namespace)
564564
return namespace['foo']
565565

566566
def expected(count, w):
567567
s = ['''\
568568
%*d LOAD_FAST 0 (x)
569-
%*d LOAD_CONST 1 (1)
569+
%*d LOAD_CONST 1 (1000000)
570570
%*d BINARY_ADD
571571
%*d STORE_FAST 0 (x)
572572
''' % (w, 8*i, w, 8*i + 2, w, 8*i + 4, w, 8*i + 6)
@@ -783,7 +783,7 @@ def f(c=c):
783783
Stack size: 2
784784
Flags: NOFREE
785785
Constants:
786-
0: 1
786+
0: 1000000
787787
Names:
788788
0: x"""
789789

@@ -797,7 +797,7 @@ def f(c=c):
797797
Stack size: 2
798798
Flags: NOFREE
799799
Constants:
800-
0: 1
800+
0: 1000000
801801
1: None
802802
Names:
803803
0: x"""

0 commit comments

Comments
 (0)