Find the offsets in a byte code which are start of lines in the source. Generate pairs (offset, lineno)
(code)
| 637 | return labels |
| 638 | |
| 639 | def findlinestarts(code): |
| 640 | """Find the offsets in a byte code which are start of lines in the source. |
| 641 | |
| 642 | Generate pairs (offset, lineno) |
| 643 | """ |
| 644 | lastline = None |
| 645 | for start, end, line in code.co_lines(): |
| 646 | if line is not None and line != lastline: |
| 647 | lastline = line |
| 648 | yield start, line |
| 649 | return |
| 650 | |
| 651 | def _find_imports(co): |
| 652 | """Find import statements in the code |
no outgoing calls
no test coverage detected