(obj)
| 123 | |
| 124 | |
| 125 | def findsource(obj) -> tuple[Source | None, int]: |
| 126 | try: |
| 127 | sourcelines, lineno = inspect.findsource(obj) |
| 128 | except Exception: |
| 129 | return None, -1 |
| 130 | source = Source() |
| 131 | source.lines = [line.rstrip() for line in sourcelines] |
| 132 | source.raw_lines = sourcelines |
| 133 | return source, lineno |
| 134 | |
| 135 | |
| 136 | def getrawcode(obj: object, trycall: bool = True) -> types.CodeType: |