@@ -16,17 +16,17 @@ def __init__(self):
1616 code = (lambda : x if x else y ).__code__ .co_code
1717 opcode , oparg = struct .unpack_from ('BB' , code , 2 )
1818
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
2020 # 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 .
2323 # https://bugs.python.org/issue26647
2424 if dis .opname [opcode ] == 'POP_JUMP_IF_FALSE' :
2525 self .argument = struct .Struct ('B' )
2626 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).
3030 # https://bugs.python.org/issue26647
3131 self .jump_unit = 8 // oparg
3232 else :
@@ -43,13 +43,11 @@ def argument_bits(self):
4343
4444
4545def _make_code (code , codestring ):
46- args = [
47- code .co_argcount , code .co_nlocals , code .co_stacksize ,
48- code .co_flags , codestring , code .co_consts ,
49- code .co_names , code .co_varnames , code .co_filename ,
50- code .co_name , code .co_firstlineno , code .co_lnotab ,
51- code .co_freevars , code .co_cellvars
52- ]
46+ args = [code .co_argcount , code .co_nlocals , code .co_stacksize ,
47+ code .co_flags , codestring , code .co_consts ,
48+ code .co_names , code .co_varnames , code .co_filename ,
49+ code .co_name , code .co_firstlineno , code .co_lnotab ,
50+ code .co_freevars , code .co_cellvars ]
5351
5452 try :
5553 args .insert (1 , code .co_kwonlyargcount ) # PY3
@@ -155,8 +153,9 @@ def _find_labels_and_gotos(code):
155153 name = code .co_names [oparg1 ]
156154 if name == 'label' :
157155 if oparg2 in labels :
158- co_name = code .co_names [oparg2 ]
159- raise SyntaxError ('Ambiguous label {0!r}' .format (co_name ))
156+ raise SyntaxError ('Ambiguous label {0!r}' .format (
157+ code .co_names [oparg2 ]
158+ ))
160159 labels [oparg2 ] = (offset1 ,
161160 offset4 ,
162161 tuple (block_stack ))
@@ -196,7 +195,9 @@ def _patch_code(code):
196195 try :
197196 _ , target , target_stack = labels [label ]
198197 except KeyError :
199- raise SyntaxError ('Unknown label {0!r}' .format (code .co_names [label ]))
198+ raise SyntaxError ('Unknown label {0!r}' .format (
199+ code .co_names [label ]
200+ ))
200201
201202 target_depth = len (target_stack )
202203 if origin_stack [:target_depth ] != target_stack :
0 commit comments