| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -109,18 +109,16 @@ def pump_stream(cmdline: List[str], name: str, stream: Union[BinaryIO, TextIO], | |||
| 109 | 109 | else: | |
| 110 | 110 | handler(line) | |
| 111 | 111 | except Exception as ex: | |
| 112 | - log.error(f"Pumping {name!r} of cmd({remove_password_if_present(cmdline)})} failed due to: {ex!r}") | ||
| 112 | + log.error(f"Pumping {name!r} of cmd({remove_password_if_present(cmdline)}) failed due to: {ex!r}") | ||
| 113 | 113 | raise CommandError([f'<{name}-pump>'] + remove_password_if_present(cmdline), ex) from ex | |
| 114 | 114 | finally: | |
| 115 | 115 | stream.close() | |
| 116 | 116 | ||
| 117 | - | ||
| 118 | - | ||
| 119 | 117 | if hasattr(process, 'proc'): | |
| 120 | 118 | process = cast('Git.AutoInterrupt', process) | |
| 121 | 119 | cmdline: str | Tuple[str, ...] | List[str] = getattr(process.proc, 'args', '') | |
| 122 | - p_stdout = process.proc.stdout | ||
| 123 | - p_stderr = process.proc.stderr | ||
| 120 | + p_stdout = process.proc.stdout if process.proc else None | ||
| 121 | + p_stderr = process.proc.stderr if process.proc else None | ||
| 124 | 122 | else: | |
| 125 | 123 | process = cast(Popen, process) | |
| 126 | 124 | cmdline = getattr(process, 'args', '') | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,7 +31,7 @@ | |||
| 31 | 31 | # typing------------------------------------------------------- | |
| 32 | 32 | ||
| 33 | 33 | from typing import (Any, Callable, Generic, IO, List, Dict, Sequence, | |
| 34 | - TYPE_CHECKING, Tuple, TypeVar, Union, cast, overload) | ||
| 34 | + TYPE_CHECKING, Tuple, TypeVar, Union, cast) | ||
| 35 | 35 | ||
| 36 | 36 | from git.types import Lit_config_levels, ConfigLevels_Tup, PathLike, assert_never, _T | |
| 37 | 37 | ||
@@ -709,15 +709,6 @@ def read_only(self) -> bool: | |||
| 709 | 709 | """:return: True if this instance may change the configuration file""" | |
| 710 | 710 | return self._read_only | |
| 711 | 711 | ||
| 712 | - @overload | ||
| 713 | - def get_value(self, section: str, option: str, default: None = None) -> Union[int, float, str, bool]: ... | ||
| 714 | - | ||
| 715 | - @overload | ||
| 716 | - def get_value(self, section: str, option: str, default: str) -> str: ... | ||
| 717 | - | ||
| 718 | - @overload | ||
| 719 | - def get_value(self, section: str, option: str, default: float) -> float: ... | ||
| 720 | - | ||
| 721 | 712 | def get_value(self, section: str, option: str, default: Union[int, float, str, bool, None] = None | |
| 722 | 713 | ) -> Union[int, float, str, bool]: | |
| 723 | 714 | # can default or return type include bool? | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -446,6 +446,8 @@ def create_from_tree(cls, repo: 'Repo', tree: Union[Tree, str], message: str, | |||
| 446 | 446 | # assume utf8 encoding | |
| 447 | 447 | enc_section, enc_option = cls.conf_encoding.split('.') | |
| 448 | 448 | conf_encoding = cr.get_value(enc_section, enc_option, cls.default_encoding) | |
| 449 | + if not isinstance(conf_encoding, str): | ||
| 450 | + raise TypeError("conf_encoding could not be coerced to str") | ||
| 449 | 451 | ||
| 450 | 452 | # if the tree is no object, make sure we create one - otherwise | |
| 451 | 453 | # the created commit object is invalid | |
| Back | FazBrowse Home | New Git URL |
0 commit comments