Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Revert compiling GitCommand shell messages#1222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Byron merged 1 commit intogitpython-developers:mainfromjmcgill298:bugfix-1220
Apr 22, 2021
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletionsgit/compat.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,7 +18,7 @@

# typing --------------------------------------------------------------------

from typing import Any, AnyStr, Dict, Optional, Type
from typing importIO,Any, AnyStr, Dict, Optional, Type, Union
from git.types import TBD

# ---------------------------------------------------------------------------
Expand All@@ -30,7 +30,7 @@
defenc = sys.getfilesystemencoding()


def safe_decode(s:Optional[AnyStr]) -> Optional[str]:
def safe_decode(s:Union[IO[str],AnyStr, None]) -> Optional[str]:
"""Safely decodes a binary string to unicode"""
if isinstance(s, str):
return s
Expand Down
8 changes: 5 additions & 3 deletionsgit/exc.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -65,10 +65,12 @@ def __init__(self, command: Union[List[str], Tuple[str, ...], str],
status = "'%s'" % s if isinstance(status, str) else s

self._cmd = safe_decode(command[0])
self._cmdline = ' '.join(str(safe_decode(i)) for i in command)
self._cmdline = ' '.join(safe_decode(i) for i in command)
self._cause = status and " due to: %s" % status or "!"
self.stdout = stdout and "\n stdout: '%s'" % safe_decode(str(stdout)) or ''
self.stderr = stderr and "\n stderr: '%s'" % safe_decode(str(stderr)) or ''
stdout_decode = safe_decode(stdout)
stderr_decode = safe_decode(stderr)
self.stdout = stdout_decode and "\n stdout: '%s'" % stdout_decode or ''
self.stderr = stderr_decode and "\n stderr: '%s'" % stderr_decode or ''

def __str__(self) -> str:
return (self._msg + "\n cmdline: %s%s%s") % (
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp