| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,7 +4,6 @@ | |||
| 4 | 4 | # This module is part of GitPython and is released under | |
| 5 | 5 | # the BSD License: http://www.opensource.org/licenses/bsd-license.php | |
| 6 | 6 | from mimetypes import guess_type | |
| 7 | - from typing import Tuple, Union | ||
| 8 | 7 | from . import base | |
| 9 | 8 | ||
| 10 | 9 | __all__ = ('Blob', ) | |
@@ -24,7 +23,7 @@ class Blob(base.IndexObject): | |||
| 24 | 23 | __slots__ = () | |
| 25 | 24 | ||
| 26 | 25 | @property | |
| 27 | - def mime_type(self) -> Union[None, str, Tuple[Union[None, str], Union[None, str]]]: | ||
| 26 | + def mime_type(self) -> str: | ||
| 28 | 27 | """ | |
| 29 | 28 | :return: String describing the mime type of this file (based on the filename) | |
| 30 | 29 | :note: Defaults to 'text/plain' in case the actual file type is unknown. """ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,10 +19,10 @@ | |||
| 19 | 19 | from datetime import datetime, timedelta, tzinfo | |
| 20 | 20 | ||
| 21 | 21 | # 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) | ||
| 23 | 23 | ||
| 24 | 24 | if TYPE_CHECKING: | |
| 25 | - from io import BytesIO | ||
| 25 | + from io import BytesIO, StringIO | ||
| 26 | 26 | from .submodule.base import Submodule | |
| 27 | 27 | from .commit import Commit | |
| 28 | 28 | from .blob import Blob | |
@@ -267,7 +267,7 @@ class ProcessStreamAdapter(object): | |||
| 267 | 267 | ||
| 268 | 268 | def __init__(self, process: 'Popen', stream_name: str) -> None: | |
| 269 | 269 | self._proc = process | |
| 270 | - self._stream = getattr(process, stream_name) # type: IO[str] ## guess | ||
| 270 | + self._stream = getattr(process, stream_name) # type: StringIO ## guess | ||
| 271 | 271 | ||
| 272 | 272 | def __getattr__(self, attr: str) -> Any: | |
| 273 | 273 | return getattr(self._stream, attr) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments