There was an error while loading. Please reload this page.
1 parent f23994e commit 475a7e1Copy full SHA for 475a7e1
1 file changed
git/types.py
@@ -6,22 +6,18 @@
6
import os
7
import sys
8
from typing import (
9
- Callable,
10
Dict,
11
NoReturn,
12
Sequence,
13
Tuple,
14
Union,
15
Any,
16
- Iterator, # noqa: F401
17
- NamedTuple,
18
TYPE_CHECKING,
19
TypeVar,
20
) # noqa: F401
21
22
if sys.version_info[:2] >= (3, 8):
23
24
- Final,
25
Literal,
26
SupportsIndex,
27
TypedDict,
@@ -30,7 +26,6 @@
30
31
else:
32
28
from typing_extensions import (
33
34
29
35
SupportsIndex, # noqa: F401
36
@@ -45,10 +40,10 @@
45
40
46
41
47
42
if sys.version_info[:2] < (3, 9):
48
- PathLike = Union[str, os.PathLike]
49
-elif sys.version_info[:2] >= (3, 9):
43
+ PathLike = Union[str, bytes, os.PathLike]
44
+else:
50
# os.PathLike only becomes subscriptable from Python 3.9 onwards
51
+ PathLike = Union[str, bytes, os.PathLike[str], os.PathLike[bytes]]
52
53
if TYPE_CHECKING:
54
from git.repo import Repo
@@ -92,8 +87,6 @@ def assert_never(inp: NoReturn, raise_error: bool = True, exc: Union[Exception,
92
87
raise ValueError(f"An unhandled Literal ({inp}) in an if/else chain was found")
93
88
94
89
raise exc
95
- else:
96
- pass
97
90
98
91
99
class Files_TD(TypedDict):
0 commit comments