()
| 79 | return _get_code_lines(code) |
| 80 | |
| 81 | def iterate(): |
| 82 | # First, get all line starts for this code object. This does not include |
| 83 | # bodies of nested class and function definitions, as they have their |
| 84 | # own objects. |
| 85 | for _, lineno in dis.findlinestarts(code): |
| 86 | if lineno is not None: |
| 87 | yield lineno |
| 88 | |
| 89 | # For nested class and function definitions, their respective code objects |
| 90 | # are constants referenced by this object. |
| 91 | for const in code.co_consts: |
| 92 | if isinstance(const, types.CodeType) and const.co_filename == code.co_filename: |
| 93 | for lineno in _get_code_lines(const): |
| 94 | yield lineno |
| 95 | |
| 96 | return iterate() |
| 97 |
no test coverage detected