Skip to content

Commit b4fe276

Browse files
committed
move cmd.py types to another branch, mark typing import as unused
1 parent 2d92fee commit b4fe276

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

Diff for: git/cmd.py

+4-7
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import threading
2020
from collections import OrderedDict
2121
from textwrap import dedent
22-
from typing import Any, Callable, Optional, Type
2322

2423
from git.compat import (
2524
defenc,
@@ -58,7 +57,7 @@
5857
## @{
5958

6059
def handle_process_output(process, stdout_handler, stderr_handler,
61-
finalizer=None, decode_streams: bool=True) -> Optional[Any]:
60+
finalizer=None, decode_streams=True):
6261
"""Registers for notifications to learn that process output is ready to read, and dispatches lines to
6362
the respective line handlers.
6463
This function returns once the finalizer returns
@@ -114,11 +113,9 @@ def pump_stream(cmdline, name, stream, is_decode, handler):
114113

115114
if finalizer:
116115
return finalizer(process)
117-
else:
118-
return None
119116

120117

121-
def dashify(string: str) -> str:
118+
def dashify(string):
122119
return string.replace('_', '-')
123120

124121

@@ -307,11 +304,11 @@ def refresh(cls, path=None):
307304
return has_git
308305

309306
@classmethod
310-
def is_cygwin(cls) -> bool:
307+
def is_cygwin(cls):
311308
return is_cygwin_git(cls.GIT_PYTHON_GIT_EXECUTABLE)
312309

313310
@classmethod
314-
def polish_url(cls, url, is_cygwin: Optional[bool]=None):
311+
def polish_url(cls, url, is_cygwin=None):
315312
if is_cygwin is None:
316313
is_cygwin = cls.is_cygwin()
317314

Diff for: git/types.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import os
2-
from typing import Optional, Union, Any
1+
import os # @UnusedImport ## not really unused, is in type string
2+
from typing import Union, Any
33

44

55
TBD = Any
6-
PathLike = Union[str, os.PathLike[str]]
6+
PathLike = Union[str, 'os.PathLike[str]']

0 commit comments

Comments
 (0)