There was an error while loading. Please reload this page.
1 parent c51f938 commit 90f0fb8Copy full SHA for 90f0fb8
2 files changed
git/objects/blob.py
@@ -4,7 +4,6 @@
4
# This module is part of GitPython and is released under
5
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
6
from mimetypes import guess_type
7
-from typing import Tuple, Union
8
from . import base
9
10
__all__ = ('Blob', )
@@ -24,7 +23,7 @@ class Blob(base.IndexObject):
24
23
__slots__ = ()
25
26
@property
27
- def mime_type(self) -> Union[None, str, Tuple[Union[None, str], Union[None, str]]]:
+ def mime_type(self) -> str:
28
"""
29
:return: String describing the mime type of this file (based on the filename)
30
:note: Defaults to 'text/plain' in case the actual file type is unknown. """
git/objects/util.py
@@ -19,10 +19,10 @@
19
from datetime import datetime, timedelta, tzinfo
20
21
# typing ------------------------------------------------------------
22
-from typing import (Any, Callable, Deque, IO, Iterator, Sequence, TYPE_CHECKING, Tuple, Type, Union, cast, overload)
+from typing import (Any, Callable, Deque, Iterator, Sequence, TYPE_CHECKING, Tuple, Type, Union, cast, overload)
if TYPE_CHECKING:
- from io import BytesIO
+ from io import BytesIO, StringIO
from .submodule.base import Submodule
from .commit import Commit
from .blob import Blob
@@ -267,7 +267,7 @@ class ProcessStreamAdapter(object):
267
268
def __init__(self, process: 'Popen', stream_name: str) -> None:
269
self._proc = process
270
- self._stream = getattr(process, stream_name) # type: IO[str] ## guess
+ self._stream = getattr(process, stream_name) # type: StringIO ## guess
271
272
def __getattr__(self, attr: str) -> Any:
273
return getattr(self._stream, attr)
0 commit comments