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

Commitc7392d6

Browse files
Harmon758Byron
authored andcommitted
Remove and replace compat.binary_type
1 parentfc209ec commitc7392d6

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

‎git/compat.py‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@
3131
is_darwin = (os.name == 'darwin')
3232
defenc = sys.getfilesystemencoding()
3333

34-
if PY3:
35-
binary_type = bytes
36-
else:
37-
binary_type = str
38-
3934

4035
def safe_decode(s):
4136
"""Safely decodes a binary string to unicode"""

‎git/diff.py‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
)
1313
from git.util import finalize_process, hex_to_bin
1414

15-
from .compat import binary_type
1615
from .objects.blob import Blob
1716
from .objects.util import mode_str_to_int
1817

@@ -268,8 +267,8 @@ def __init__(self, repo, a_rawpath, b_rawpath, a_blob_id, b_blob_id, a_mode,
268267
self.a_mode = a_mode
269268
self.b_mode = b_mode
270269

271-
assert a_rawpath is None or isinstance(a_rawpath,binary_type)
272-
assert b_rawpath is None or isinstance(b_rawpath,binary_type)
270+
assert a_rawpath is None or isinstance(a_rawpath,bytes)
271+
assert b_rawpath is None or isinstance(b_rawpath,bytes)
273272
self.a_rawpath = a_rawpath
274273
self.b_rawpath = b_rawpath
275274

@@ -302,8 +301,8 @@ def __init__(self, repo, a_rawpath, b_rawpath, a_blob_id, b_blob_id, a_mode,
302301
self.copied_file = copied_file
303302

304303
# be clear and use None instead of empty strings
305-
assert raw_rename_from is None or isinstance(raw_rename_from,binary_type)
306-
assert raw_rename_to is None or isinstance(raw_rename_to,binary_type)
304+
assert raw_rename_from is None or isinstance(raw_rename_from,bytes)
305+
assert raw_rename_to is None or isinstance(raw_rename_to,bytes)
307306
self.raw_rename_from = raw_rename_from or None
308307
self.raw_rename_to = raw_rename_to or None
309308

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp