(self, source: Source)
| 898 | ) |
| 899 | |
| 900 | def _getindent(self, source: Source) -> int: |
| 901 | class="cm"># Figure out indent for the given source. |
| 902 | try: |
| 903 | s = str(source.getstatement(len(source) - 1)) |
| 904 | except KeyboardInterrupt: |
| 905 | raise |
| 906 | except BaseException: |
| 907 | try: |
| 908 | s = str(source[-1]) |
| 909 | except KeyboardInterrupt: |
| 910 | raise |
| 911 | except BaseException: |
| 912 | return 0 |
| 913 | return 4 + (len(s) - len(s.lstrip())) |
| 914 | |
| 915 | def _getentrysource(self, entry: TracebackEntry) -> Source | None: |
| 916 | source = entry.getsource(self.astcache) |
no test coverage detected