There was an error while loading. Please reload this page.
1 parent b5c834a commit eb15123Copy full SHA for eb15123
1 file changed
git/util.py
@@ -1214,9 +1214,7 @@ def __getitem__(self, index: Union[SupportsIndex, int, slice, str]) -> T_Iterabl
1214
raise ValueError("Index should be an int or str")
1215
else:
1216
try:
1217
- if not isinstance(index, str):
1218
- raise AttributeError(f"{index} is not a valid attribute")
1219
- return getattr(self, index)
+ return getattr(self, cast(str, index))
1220
except AttributeError as e:
1221
raise IndexError(f"No item found with id {self._prefix}{index}") from e
1222
# END handle getattr
0 commit comments