@@ -392,7 +392,7 @@ def _get_name_info(name_index, get_name, **extrainfo):
392
392
else :
393
393
return UNKNOWN , ''
394
394
395
- def parse_varint (iterator ):
395
+ def _parse_varint (iterator ):
396
396
b = next (iterator )
397
397
val = b & 63
398
398
while b & 64 :
@@ -401,16 +401,16 @@ def parse_varint(iterator):
401
401
val |= b & 63
402
402
return val
403
403
404
- def parse_exception_table (code ):
404
+ def _parse_exception_table (code ):
405
405
iterator = iter (code .co_exceptiontable )
406
406
entries = []
407
407
try :
408
408
while True :
409
- start = parse_varint (iterator )* 2
410
- length = parse_varint (iterator )* 2
409
+ start = _parse_varint (iterator )* 2
410
+ length = _parse_varint (iterator )* 2
411
411
end = start + length
412
- target = parse_varint (iterator )* 2
413
- dl = parse_varint (iterator )
412
+ target = _parse_varint (iterator )* 2
413
+ dl = _parse_varint (iterator )
414
414
depth = dl >> 1
415
415
lasti = bool (dl & 1 )
416
416
entries .append (_ExceptionTableEntry (start , end , target , depth , lasti ))
@@ -519,7 +519,7 @@ def _get_instructions_bytes(code, varname_from_oparg=None,
519
519
def disassemble (co , lasti = - 1 , * , file = None , show_caches = False , adaptive = False ):
520
520
"""Disassemble a code object."""
521
521
linestarts = dict (findlinestarts (co ))
522
- exception_entries = parse_exception_table (co )
522
+ exception_entries = _parse_exception_table (co )
523
523
_disassemble_bytes (_get_code_array (co , adaptive ),
524
524
lasti , co ._varname_from_oparg ,
525
525
co .co_names , co .co_consts , linestarts , file = file ,
@@ -706,7 +706,7 @@ def __init__(self, x, *, first_line=None, current_offset=None, show_caches=False
706
706
self ._linestarts = dict (findlinestarts (co ))
707
707
self ._original_object = x
708
708
self .current_offset = current_offset
709
- self .exception_entries = parse_exception_table (co )
709
+ self .exception_entries = _parse_exception_table (co )
710
710
self .show_caches = show_caches
711
711
self .adaptive = adaptive
712
712
0 commit comments