Skip to content

Commit 90f0fb8

Browse files
committed
change IO[str] to stringIO
1 parent c51f938 commit 90f0fb8

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

‎git/objects/blob.py

+1-2
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
from mimetypes import guess_type
7-
from typing import Tuple, Union
87
from . import base
98

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

2625
@property
27-
def mime_type(self) -> Union[None, str, Tuple[Union[None, str], Union[None, str]]]:
26+
def mime_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

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
from datetime import datetime, timedelta, tzinfo
2020

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

2424
if TYPE_CHECKING:
25-
from io import BytesIO
25+
from io import BytesIO, StringIO
2626
from .submodule.base import Submodule
2727
from .commit import Commit
2828
from .blob import Blob
@@ -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
return getattr(self._stream, attr)

0 commit comments

Comments
 (0)