[Python-checkins] cpython (2.7): Issue #26733: Fixed formatting line numbers in test_dis.

serhiy.storchaka python-checkins at python.org
Tue Apr 12 01:48:46 EDT 2016


https://hg.python.org/cpython/rev/16a27e38e9b5
changeset: 100936:16a27e38e9b5
branch: 2.7
parent: 100932:61c7deea9e6a
user: Serhiy Storchaka <storchaka at gmail.com>
date: Tue Apr 12 08:47:20 2016 +0300
summary:
 Issue #26733: Fixed formatting line numbers in test_dis.
Based on patch by Xiang Zhang.
files:
 Lib/test/test_dis.py | 16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py
--- a/Lib/test/test_dis.py
+++ b/Lib/test/test_dis.py
@@ -12,11 +12,11 @@
 return 1
 
 dis_f = """\
- %-4d 0 LOAD_FAST 0 (a)
+%3d 0 LOAD_FAST 0 (a)
 3 PRINT_ITEM
 4 PRINT_NEWLINE
 
- %-4d 5 LOAD_CONST 1 (1)
+%3d 5 LOAD_CONST 1 (1)
 8 RETURN_VALUE
 """%(_f.func_code.co_firstlineno + 1,
 _f.func_code.co_firstlineno + 2)
@@ -28,17 +28,17 @@
 pass
 
 dis_bug708901 = """\
- %-4d 0 SETUP_LOOP 23 (to 26)
+%3d 0 SETUP_LOOP 23 (to 26)
 3 LOAD_GLOBAL 0 (range)
 6 LOAD_CONST 1 (1)
 
- %-4d 9 LOAD_CONST 2 (10)
+%3d 9 LOAD_CONST 2 (10)
 12 CALL_FUNCTION 2
 15 GET_ITER
 >> 16 FOR_ITER 6 (to 25)
 19 STORE_FAST 0 (res)
 
- %-4d 22 JUMP_ABSOLUTE 16
+%3d 22 JUMP_ABSOLUTE 16
 >> 25 POP_BLOCK
 >> 26 LOAD_CONST 0 (None)
 29 RETURN_VALUE
@@ -53,7 +53,7 @@
 pass
 
 dis_bug1333982 = """\
- %-4d 0 LOAD_CONST 1 (0)
+%3d 0 LOAD_CONST 1 (0)
 3 POP_JUMP_IF_TRUE 41
 6 LOAD_GLOBAL 0 (AssertionError)
 9 BUILD_LIST 0
@@ -65,12 +65,12 @@
 25 LIST_APPEND 2
 28 JUMP_ABSOLUTE 16
 
- %-4d >> 31 LOAD_CONST 2 (1)
+%3d >> 31 LOAD_CONST 2 (1)
 34 BINARY_ADD
 35 CALL_FUNCTION 1
 38 RAISE_VARARGS 1
 
- %-4d >> 41 LOAD_CONST 0 (None)
+%3d >> 41 LOAD_CONST 0 (None)
 44 RETURN_VALUE
 """%(bug1333982.func_code.co_firstlineno + 1,
 bug1333982.func_code.co_firstlineno + 2,
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /