@@ -16,17 +16,17 @@ def __init__(self):
16
16
code = (lambda : x if x else y ).__code__ .co_code
17
17
opcode , oparg = struct .unpack_from ('BB' , code , 2 )
18
18
19
- # Starting with Python 3.6, the bytecode format has been changed to use
19
+ # Starting with Python 3.6, the bytecode format has changed, using
20
20
# 16-bit words (8-bit opcode + 8-bit argument) for each instruction,
21
- # as opposed to previously 24- bit (8-bit opcode + 16-bit argument) for
22
- # instructions that expect an argument or just 8-bit for those that don't .
21
+ # as opposed to previously 24 bit (8-bit opcode + 16-bit argument)
22
+ # for instructions that expect an argument and otherwise 8 bit .
23
23
# https://bugs.python.org/issue26647
24
24
if dis .opname [opcode ] == 'POP_JUMP_IF_FALSE' :
25
25
self .argument = struct .Struct ('B' )
26
26
self .have_argument = 0
27
- # As of Python 3.6, jump targets are still addressed by their byte
28
- # unit. This, however, is matter to change, so that jump targets,
29
- # in the future, will refer to the code unit (address in bytes / 2).
27
+ # As of Python 3.6, jump targets are still addressed by their
28
+ # byte unit. This is matter to change, so that jump targets,
29
+ # in the future might refer to code units (address in bytes / 2).
30
30
# https://bugs.python.org/issue26647
31
31
self .jump_unit = 8 // oparg
32
32
else :
@@ -155,8 +155,9 @@ def _find_labels_and_gotos(code):
155
155
name = code .co_names [oparg1 ]
156
156
if name == 'label' :
157
157
if oparg2 in labels :
158
- co_name = code .co_names [oparg2 ]
159
- raise SyntaxError ('Ambiguous label {0!r}' .format (co_name ))
158
+ raise SyntaxError ('Ambiguous label {0!r}' .format (
159
+ code .co_names [oparg2 ]
160
+ ))
160
161
labels [oparg2 ] = (offset1 ,
161
162
offset4 ,
162
163
tuple (block_stack ))
@@ -196,7 +197,9 @@ def _patch_code(code):
196
197
try :
197
198
_ , target , target_stack = labels [label ]
198
199
except KeyError :
199
- raise SyntaxError ('Unknown label {0!r}' .format (code .co_names [label ]))
200
+ raise SyntaxError ('Unknown label {0!r}' .format (
201
+ code .co_names [label ]
202
+ ))
200
203
201
204
target_depth = len (target_stack )
202
205
if origin_stack [:target_depth ] != target_stack :
0 commit comments