Skip to content

Commit 5b098ff

Browse files
authored
Merge pull request #2039 from EliahKagan/flatten-next
Fix Git.{AutoInterrupt,CatFileContentStream} static typing
2 parents 1e463d4 + c6c0812 commit 5b098ff

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

git/cmd.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@
6060
overload,
6161
)
6262

63+
if sys.version_info >= (3, 10):
64+
from typing import TypeAlias
65+
else:
66+
from typing_extensions import TypeAlias
67+
6368
from git.types import Literal, PathLike, TBD
6469

6570
if TYPE_CHECKING:
@@ -952,9 +957,9 @@ def check_unsafe_options(cls, options: List[str], unsafe_options: List[str]) ->
952957
f"{unsafe_option} is not allowed, use `allow_unsafe_options=True` to allow it."
953958
)
954959

955-
AutoInterrupt = _AutoInterrupt
960+
AutoInterrupt: TypeAlias = _AutoInterrupt
956961

957-
CatFileContentStream = _CatFileContentStream
962+
CatFileContentStream: TypeAlias = _CatFileContentStream
958963

959964
def __init__(self, working_dir: Union[None, PathLike] = None) -> None:
960965
"""Initialize this instance with:

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
gitdb>=4.0.1,<5
2-
typing-extensions>=3.7.4.3;python_version<"3.8"
2+
typing-extensions>=3.10.0.2;python_version<"3.10"

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