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

Commita083e81

Browse files
committed
try: from typing import Literal
1 parent53b2567 commita083e81

File tree

5 files changed

+27
-5
lines changed

5 files changed

+27
-5
lines changed

‎git/objects/blob.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
frommimetypesimportguess_type
77
from .importbase
88

9-
fromgit.typesimportLiteral
9+
10+
try:
11+
fromtypingimportLiteral
12+
exceptImportError:
13+
fromtyping_extensionsimportLiteral
1014

1115
__all__= ("Blob",)
1216

‎git/objects/commit.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@
4444
Dict,
4545
)
4646

47-
fromgit.typesimportPathLike,Literal
47+
fromgit.typesimportPathLike
48+
49+
try:
50+
fromtypingimportLiteral
51+
exceptImportError:
52+
fromtyping_extensionsimportLiteral
4853

4954
ifTYPE_CHECKING:
5055
fromgit.repoimportRepo

‎git/objects/submodule/base.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@
4444
fromtypingimportCallable,Dict,Mapping,Sequence,TYPE_CHECKING,cast
4545
fromtypingimportAny,Iterator,Union
4646

47-
fromgit.typesimportCommit_ish,Literal,PathLike,TBD
47+
fromgit.typesimportCommit_ish,PathLike,TBD
48+
49+
try:
50+
fromtypingimportLiteral
51+
exceptImportError:
52+
fromtyping_extensionsimportLiteral
4853

4954
ifTYPE_CHECKING:
5055
fromgit.indeximportIndexFile

‎git/objects/tag.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616

1717
fromtypingimportList,TYPE_CHECKING,Union
1818

19-
fromgit.typesimportLiteral
19+
try:
20+
fromtypingimportLiteral
21+
exceptImportError:
22+
fromtyping_extensionsimportLiteral
2023

2124
ifTYPE_CHECKING:
2225
fromgit.repoimportRepo

‎git/objects/tree.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@
3131
TYPE_CHECKING,
3232
)
3333

34-
fromgit.typesimportPathLike,Literal
34+
fromgit.typesimportPathLike
35+
36+
try:
37+
fromtypingimportLiteral
38+
exceptImportError:
39+
fromtyping_extensionsimportLiteral
3540

3641
ifTYPE_CHECKING:
3742
fromgit.repoimportRepo

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp