MCPcopy
hub / github.com/rocky/python-uncompyle6 / line_number_mapping

Function line_number_mapping

uncompyle6/linenumbers.py:29–50  ·  view source on GitHub ↗
(pyc_filename, src_filename)

Source from the content-addressed store, hash-verified

27
28
29def line_number_mapping(pyc_filename, src_filename):
30 (
31 version,
32 timestamp,
33 magic_int,
34 code1,
35 is_pypy,
36 source_size,
37 sip_hash,
38 ) = load_module(pyc_filename)
39 try:
40 code2 = load_file(src_filename)
41 except SyntaxError as e:
42 return str(e)
43
44 queue = deque([code1, code2])
45
46 mappings = []
47
48 opc = get_opcode(version, is_pypy)
49 number_loop(queue, mappings, opc)
50 return sorted(mappings, key=lambda x: x[1])
51
52
53def number_loop(queue, mappings, opc):

Callers

nothing calls this directly

Calls 1

number_loopFunction · 0.85

Tested by

no test coverage detected