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

Commit62c0823

Browse files
committed
Consolidate str and os.PathLike[str] (use GitPython's PathLike)
Where they had been introduced and written separately in0e1df29before this.The main reason is that it would have to be quoted as a stringfor compatibility with Python 3.8 and lower, since os.PathLikeonly defined __class_getitem__ in 3.8 and later. (The definitionin git.types already does that.) In addition, the benefit ofkeeping them separate was negligible, as mentioned in0e1df29.
1 parent0e1df29 commit62c0823

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

‎git/diff.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# This module is part of GitPython and is released under the
44
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
55

6-
importos
76
importre
87

98
fromgit.cmdimporthandle_process_output
@@ -100,8 +99,8 @@ class Index:
10099

101100
def_process_diff_args(
102101
self,
103-
args:List[Union[str,os.PathLike[str],"Diffable",Type["Index"]]],
104-
)->List[Union[str,os.PathLike[str],"Diffable",Type["Index"]]]:
102+
args:List[Union[PathLike,"Diffable",Type["Index"]]],
103+
)->List[Union[PathLike,"Diffable",Type["Index"]]]:
105104
"""
106105
:return:
107106
Possibly altered version of the given args list.

‎git/index/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,8 +645,8 @@ def write_tree(self) -> Tree:
645645

646646
def_process_diff_args(
647647
self,
648-
args:List[Union[str,os.PathLike[str],"git_diff.Diffable",Type["git_diff.Diffable.Index"]]],
649-
)->List[Union[str,os.PathLike[str],"git_diff.Diffable",Type["git_diff.Diffable.Index"]]]:
648+
args:List[Union[PathLike,"git_diff.Diffable",Type["git_diff.Diffable.Index"]]],
649+
)->List[Union[PathLike,"git_diff.Diffable",Type["git_diff.Diffable.Index"]]]:
650650
try:
651651
args.pop(args.index(self))
652652
exceptIndexError:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp