From 8797904d04abc2df5da93ca7d799da21e5a50cb5 Mon Sep 17 00:00:00 2001 From: Sjoerd Langkemper Date: Tue, 9 Nov 2021 12:17:02 +0000 Subject: Fix type handing on PushInfoList --- git/remote.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'git') diff --git a/git/remote.py b/git/remote.py index 74543676..aae845e5 100644 --- a/git/remote.py +++ b/git/remote.py @@ -117,14 +117,15 @@ def to_progress_instance(progress: Union[Callable[..., Any], RemoteProgress, Non class PushInfoList(IterableList): - def __new__(cls) -> 'IterableList[IterableObj]': - return super(IterableList, cls).__new__(cls, 'push_infos') + def __new__(cls) -> 'PushInfoList': + base = super().__new__(cls, 'push_infos') + return cast(PushInfoList, base) def __init__(self) -> None: super().__init__('push_infos') self.error = None - def raise_if_error(self): + def raise_if_error(self) -> None: """ Raise an exception if any ref failed to push. """ -- cgit v1.2.1