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

Commitb4fe276

Browse files
committed
move cmd.py types to another branch, mark typing import as unused
1 parent2d92fee commitb4fe276

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

‎git/cmd.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
importthreading
2020
fromcollectionsimportOrderedDict
2121
fromtextwrapimportdedent
22-
fromtypingimportAny,Callable,Optional,Type
2322

2423
fromgit.compatimport (
2524
defenc,
@@ -58,7 +57,7 @@
5857
## @{
5958

6059
defhandle_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
iffinalizer:
116115
returnfinalizer(process)
117-
else:
118-
returnNone
119116

120117

121-
defdashify(string:str)->str:
118+
defdashify(string):
122119
returnstring.replace('_','-')
123120

124121

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

309306
@classmethod
310-
defis_cygwin(cls)->bool:
307+
defis_cygwin(cls):
311308
returnis_cygwin_git(cls.GIT_PYTHON_GIT_EXECUTABLE)
312309

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

‎git/types.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
importos
2-
fromtypingimportOptional,Union,Any
1+
importos# @UnusedImport ## not really unused, is in type string
2+
fromtypingimportUnion,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)

[8]ページ先頭

©2009-2025 Movatter.jp