Skip to content

Commit f01ee4f

Browse files
committed
Apply straight-forward typing fixes
1 parent 3908e79 commit f01ee4f

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

git/cmd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def dashify(string: str) -> str:
211211
return string.replace("_", "-")
212212

213213

214-
def slots_to_dict(self: object, exclude: Sequence[str] = ()) -> Dict[str, Any]:
214+
def slots_to_dict(self: "Git", exclude: Sequence[str] = ()) -> Dict[str, Any]:
215215
return {s: getattr(self, s) for s in self.__slots__ if s not in exclude}
216216

217217

git/index/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ def _store_path(self, filepath: PathLike, fprogress: Callable) -> BaseIndexEntry
656656
def _entries_for_paths(
657657
self,
658658
paths: List[str],
659-
path_rewriter: Callable,
659+
path_rewriter: Union[Callable, None],
660660
fprogress: Callable,
661661
entries: List[BaseIndexEntry],
662662
) -> List[BaseIndexEntry]:

git/index/fun.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def run_commit_hook(name: str, index: "IndexFile", *args: str) -> None:
102102
relative_hp = Path(hp).relative_to(index.repo.working_dir).as_posix()
103103
cmd = ["bash.exe", relative_hp]
104104

105-
cmd = subprocess.Popen(
105+
process = subprocess.Popen(
106106
cmd + list(args),
107107
env=env,
108108
stdout=subprocess.PIPE,
@@ -116,13 +116,13 @@ def run_commit_hook(name: str, index: "IndexFile", *args: str) -> None:
116116
else:
117117
stdout_list: List[str] = []
118118
stderr_list: List[str] = []
119-
handle_process_output(cmd, stdout_list.append, stderr_list.append, finalize_process)
119+
handle_process_output(process, stdout_list.append, stderr_list.append, finalize_process)
120120
stdout = "".join(stdout_list)
121121
stderr = "".join(stderr_list)
122-
if cmd.returncode != 0:
122+
if process.returncode != 0:
123123
stdout = force_text(stdout, defenc)
124124
stderr = force_text(stderr, defenc)
125-
raise HookExecutionError(hp, cmd.returncode, stderr, stdout)
125+
raise HookExecutionError(hp, process.returncode, stderr, stdout)
126126
# end handle return code
127127

128128

git/objects/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def utctz_to_altz(utctz: str) -> int:
147147
return seconds if int_utctz < 0 else -seconds
148148

149149

150-
def altz_to_utctz_str(altz: int) -> str:
150+
def altz_to_utctz_str(altz: float) -> str:
151151
"""Convert a timezone offset west of UTC in seconds into a git timezone offset string
152152
153153
:param altz: timezone offset in seconds west of UTC

git/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,7 @@ class IterableList(List[T_IterableObj]):
10491049

10501050
__slots__ = ("_id_attr", "_prefix")
10511051

1052-
def __new__(cls, id_attr: str, prefix: str = "") -> "IterableList[IterableObj]":
1052+
def __new__(cls, id_attr: str, prefix: str = "") -> "IterableList[T_IterableObj]":
10531053
return super(IterableList, cls).__new__(cls)
10541054

10551055
def __init__(self, id_attr: str, prefix: str = "") -> None:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy