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

Commit8292032

Browse files
committed
Revert compiling GitCommand shell messages
1 parentd0fb22b commit8292032

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

‎git/compat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
# typing --------------------------------------------------------------------
2020

21-
fromtypingimportAny,AnyStr,Dict,Optional,Type
21+
fromtypingimportIO,Any,AnyStr,Dict,Optional,Type,Union
2222
fromgit.typesimportTBD
2323

2424
# ---------------------------------------------------------------------------
@@ -30,7 +30,7 @@
3030
defenc=sys.getfilesystemencoding()
3131

3232

33-
defsafe_decode(s:Optional[AnyStr])->Optional[str]:
33+
defsafe_decode(s:Union[IO[str],AnyStr,None])->Optional[str]:
3434
"""Safely decodes a binary string to unicode"""
3535
ifisinstance(s,str):
3636
returns

‎git/exc.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,13 @@ def __init__(self, command: Union[List[str], Tuple[str, ...], str],
6565
status="'%s'"%sifisinstance(status,str)elses
6666

6767
self._cmd=safe_decode(command[0])
68-
self._cmdline=' '.join(str(safe_decode(i))foriincommand)
68+
command_decode= [safe_decode(i)foriincommand]
69+
self._cmdline=' '.join(safe_decode(i)foriincommand_decode)
6970
self._cause=statusand" due to: %s"%statusor"!"
70-
self.stdout=stdoutand"\n stdout: '%s'"%safe_decode(str(stdout))or''
71-
self.stderr=stderrand"\n stderr: '%s'"%safe_decode(str(stderr))or''
71+
stdout_decode=safe_decode(stdout)
72+
stderr_decode=safe_decode(stderr)
73+
self.stdout=stdout_decodeand"\n stdout: '%s'"%stdout_decodeor''
74+
self.stderr=stderr_decodeand"\n stderr: '%s'"%stderr_decodeor''
7275

7376
def__str__(self)->str:
7477
return (self._msg+"\n cmdline: %s%s%s")% (

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp