| 1066 | return None |
| 1067 | |
| 1068 | def repr_traceback_entry( |
| 1069 | self, |
| 1070 | entry: TracebackEntry | None, |
| 1071 | excinfo: ExceptionInfo[BaseException] | None = None, |
| 1072 | ) -> ReprEntry: |
| 1073 | lines: list[str] = [] |
| 1074 | style = ( |
| 1075 | entry._repr_style |
| 1076 | if entry is not None and entry._repr_style is not None |
| 1077 | else self.style |
| 1078 | ) |
| 1079 | if style in (class="st">"short", class="st">"long") and entry is not None: |
| 1080 | source = self._getentrysource(entry) |
| 1081 | if source is None: |
| 1082 | source = Source(class="st">"???") |
| 1083 | line_index = 0 |
| 1084 | end_line_index, colno, end_colno = None, None, None |
| 1085 | else: |
| 1086 | line_index = entry.relline |
| 1087 | end_line_index = entry.end_lineno_relative |
| 1088 | colno = entry.colno |
| 1089 | end_colno = entry.end_colno |
| 1090 | short = style == class="st">"short" |
| 1091 | reprargs = self.repr_args(entry) if not short else None |
| 1092 | s = self.get_source( |
| 1093 | source=source, |
| 1094 | line_index=line_index, |
| 1095 | excinfo=excinfo, |
| 1096 | short=short, |
| 1097 | end_line_index=end_line_index, |
| 1098 | colno=colno, |
| 1099 | end_colno=end_colno, |
| 1100 | ) |
| 1101 | lines.extend(s) |
| 1102 | if short: |
| 1103 | message = fclass="st">"in {entry.name}" |
| 1104 | else: |
| 1105 | message = (excinfo and excinfo.typename) or class="st">"" |
| 1106 | entry_path = entry.path |
| 1107 | path = self._makepath(entry_path) |
| 1108 | reprfileloc = ReprFileLocation(path, entry.lineno + 1, message) |
| 1109 | localsrepr = self.repr_locals(entry.locals) |
| 1110 | return ReprEntry(lines, reprargs, localsrepr, reprfileloc, style) |
| 1111 | elif style == class="st">"value": |
| 1112 | if excinfo: |
| 1113 | lines.extend(str(excinfo.value).split(class="st">"\n")) |
| 1114 | return ReprEntry(lines, None, None, None, style) |
| 1115 | else: |
| 1116 | if excinfo: |
| 1117 | lines.extend(self.get_exconly(excinfo, indent=4)) |
| 1118 | return ReprEntry(lines, None, None, None, style) |
| 1119 | |
| 1120 | def _makepath(self, path: Path | str) -> str: |
| 1121 | if not self.abspath and isinstance(path, Path): |