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

Commit6bdaa46

Browse files
committed
Drop dependency on six
1 parent1875885 commit6bdaa46

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

‎git/compat.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
# flake8: noqa
99

1010
importsys
11-
importsix
1211

1312
fromgitdb.utils.compatimport (
1413
PY3,
@@ -34,6 +33,7 @@ def bchr(n):
3433
returnbytes([n])
3534
defmviter(d):
3635
returnd.values()
36+
range=xrange
3737
unicode=str
3838
else:
3939
FileType=file
@@ -44,6 +44,7 @@ def mviter(d):
4444
byte_ord=ord
4545
bchr=chr
4646
unicode=unicode
47+
range=xrange
4748
defmviter(d):
4849
returnd.itervalues()
4950

@@ -52,9 +53,9 @@ def mviter(d):
5253

5354
defsafe_decode(s):
5455
"""Safely decodes a binary string to unicode"""
55-
ifisinstance(s,six.text_type):
56+
ifisinstance(s,unicode):
5657
returns
57-
elifisinstance(s,six.binary_type):
58+
elifisinstance(s,bytes):
5859
ifPRE_PY27:
5960
# Python 2.6 does not support the `errors` argument, so we cannot
6061
# control the replacement of unsafe chars in it.

‎git/repo/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@
5454
defenc,
5555
PY3,
5656
safe_decode,
57+
range,
5758
)
5859

5960
importos
6061
importsys
6162
importre
62-
fromsix.movesimportrange
6363

6464
DefaultDBType=GitCmdObjectDB
6565
ifsys.version_info[:2]< (2,5):# python 2.4 compatiblity

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp