diff options
author | Yobmod <yobmod@gmail.com> | 2021-05-20 21:51:56 +0100 |
---|---|---|
committer | Yobmod <yobmod@gmail.com> | 2021-05-20 21:51:56 +0100 |
commit | 90f0fb8f449b6d3e4f12c28d8699ee79a6763b80 (patch) | |
tree | 7e1fa702558116fe575797a6df317c90af8c96b7 | |
parent | c51f93823d46f0882b49822ce6f9e668228e5b8d (diff) | |
download | gitpython-90f0fb8f449b6d3e4f12c28d8699ee79a6763b80.tar.gz |
change IO[str] to stringIO
-rw-r--r-- | git/objects/blob.py | 3 | ||||
-rw-r--r-- | git/objects/util.py | 6 |
2 files changed, 4 insertions, 5 deletions
diff --git a/git/objects/blob.py b/git/objects/blob.py index 013eaf8c..017178f0 100644 --- a/git/objects/blob.py +++ b/git/objects/blob.py @@ -4,7 +4,6 @@ # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php from mimetypes import guess_type -from typing import Tuple, Union from . import base __all__ = ('Blob', ) @@ -24,7 +23,7 @@ class Blob(base.IndexObject): __slots__ = () @property - def mime_type(self) -> Union[None, str, Tuple[Union[None, str], Union[None, str]]]: + def mime_type(self) -> str: """ :return: String describing the mime type of this file (based on the filename) :note: Defaults to 'text/plain' in case the actual file type is unknown. """ diff --git a/git/objects/util.py b/git/objects/util.py index b94e9f12..087f0166 100644 --- a/git/objects/util.py +++ b/git/objects/util.py @@ -19,10 +19,10 @@ import calendar from datetime import datetime, timedelta, tzinfo # typing ------------------------------------------------------------ -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): def __init__(self, process: 'Popen', stream_name: str) -> None: self._proc = process - self._stream = getattr(process, stream_name) # type: IO[str] ## guess + self._stream = getattr(process, stream_name) # type: StringIO ## guess def __getattr__(self, attr: str) -> Any: return getattr(self._stream, attr) |