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

Commit90f0fb8

Browse files
committed
change IO[str] to stringIO
1 parentc51f938 commit90f0fb8

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

‎git/objects/blob.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# This module is part of GitPython and is released under
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66
frommimetypesimportguess_type
7-
fromtypingimportTuple,Union
87
from .importbase
98

109
__all__= ('Blob', )
@@ -24,7 +23,7 @@ class Blob(base.IndexObject):
2423
__slots__= ()
2524

2625
@property
27-
defmime_type(self)->Union[None,str,Tuple[Union[None,str],Union[None,str]]]:
26+
defmime_type(self)->str:
2827
"""
2928
:return: String describing the mime type of this file (based on the filename)
3029
:note: Defaults to 'text/plain' in case the actual file type is unknown. """

‎git/objects/util.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
fromdatetimeimportdatetime,timedelta,tzinfo
2020

2121
# typing ------------------------------------------------------------
22-
fromtypingimport (Any,Callable,Deque,IO,Iterator,Sequence,TYPE_CHECKING,Tuple,Type,Union,cast,overload)
22+
fromtypingimport (Any,Callable,Deque,Iterator,Sequence,TYPE_CHECKING,Tuple,Type,Union,cast,overload)
2323

2424
ifTYPE_CHECKING:
25-
fromioimportBytesIO
25+
fromioimportBytesIO,StringIO
2626
from .submodule.baseimportSubmodule
2727
from .commitimportCommit
2828
from .blobimportBlob
@@ -267,7 +267,7 @@ class ProcessStreamAdapter(object):
267267

268268
def__init__(self,process:'Popen',stream_name:str)->None:
269269
self._proc=process
270-
self._stream=getattr(process,stream_name)# type:IO[str] ## guess
270+
self._stream=getattr(process,stream_name)# type:StringIO ## guess
271271

272272
def__getattr__(self,attr:str)->Any:
273273
returngetattr(self._stream,attr)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp