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

Appearance settings

Commit b4fe276

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

2 files changed

+7-10Lines changed: 7 additions & 10 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎git/cmd.py‎

Copy file name to clipboardExpand all lines: git/cmd.py
+4-7Lines changed: 4 additions & 7 deletions
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

Collapse file

‎git/types.py‎

Copy file name to clipboard
+3-3Lines changed: 3 additions & 3 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.