Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf01ee4f

Browse files
committed
Apply straight-forward typing fixes
1 parent3908e79 commitf01ee4f

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
returnstring.replace("_","-")
212212

213213

214-
defslots_to_dict(self:object,exclude:Sequence[str]= ())->Dict[str,Any]:
214+
defslots_to_dict(self:"Git",exclude:Sequence[str]= ())->Dict[str,Any]:
215215
return {s:getattr(self,s)forsinself.__slots__ifsnotinexclude}
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-
ifcmd.returncode!=0:
122+
ifprocess.returncode!=0:
123123
stdout=force_text(stdout,defenc)
124124
stderr=force_text(stderr,defenc)
125-
raiseHookExecutionError(hp,cmd.returncode,stderr,stdout)
125+
raiseHookExecutionError(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
returnsecondsifint_utctz<0else-seconds
148148

149149

150-
defaltz_to_utctz_str(altz:int)->str:
150+
defaltz_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
returnsuper(IterableList,cls).__new__(cls)
10541054

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp