@@ -394,7 +394,7 @@ def _get_name_info(name_index, get_name, **extrainfo):
394
394
else :
395
395
return UNKNOWN , ''
396
396
397
- def parse_varint (iterator ):
397
+ def _parse_varint (iterator ):
398
398
b = next (iterator )
399
399
val = b & 63
400
400
while b & 64 :
@@ -403,16 +403,16 @@ def parse_varint(iterator):
403
403
val |= b & 63
404
404
return val
405
405
406
- def parse_exception_table (code ):
406
+ def _parse_exception_table (code ):
407
407
iterator = iter (code .co_exceptiontable )
408
408
entries = []
409
409
try :
410
410
while True :
411
- start = parse_varint (iterator )* 2
412
- length = parse_varint (iterator )* 2
411
+ start = _parse_varint (iterator )* 2
412
+ length = _parse_varint (iterator )* 2
413
413
end = start + length
414
- target = parse_varint (iterator )* 2
415
- dl = parse_varint (iterator )
414
+ target = _parse_varint (iterator )* 2
415
+ dl = _parse_varint (iterator )
416
416
depth = dl >> 1
417
417
lasti = bool (dl & 1 )
418
418
entries .append (_ExceptionTableEntry (start , end , target , depth , lasti ))
@@ -527,7 +527,7 @@ def _get_instructions_bytes(code, varname_from_oparg=None,
527
527
def disassemble (co , lasti = - 1 , * , file = None , show_caches = False , adaptive = False ):
528
528
"""Disassemble a code object."""
529
529
linestarts = dict (findlinestarts (co ))
530
- exception_entries = parse_exception_table (co )
530
+ exception_entries = _parse_exception_table (co )
531
531
_disassemble_bytes (_get_code_array (co , adaptive ),
532
532
lasti , co ._varname_from_oparg ,
533
533
co .co_names , co .co_consts , linestarts , file = file ,
@@ -717,7 +717,7 @@ def __init__(self, x, *, first_line=None, current_offset=None, show_caches=False
717
717
self ._linestarts = dict (findlinestarts (co ))
718
718
self ._original_object = x
719
719
self .current_offset = current_offset
720
- self .exception_entries = parse_exception_table (co )
720
+ self .exception_entries = _parse_exception_table (co )
721
721
self .show_caches = show_caches
722
722
self .adaptive = adaptive
723
723
0 commit comments