Skip to content

Commit 722473e

Browse files
committed
Remove Python 2.6 hack
Since support was dropped.
1 parent 28afef5 commit 722473e

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

git/compat.py

+1-8
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,13 @@ def mviter(d):
4848
def mviter(d):
4949
return d.itervalues()
5050

51-
PRE_PY27 = sys.version_info < (2, 7)
52-
5351

5452
def safe_decode(s):
5553
"""Safely decodes a binary string to unicode"""
5654
if isinstance(s, unicode):
5755
return s
5856
elif isinstance(s, bytes):
59-
if PRE_PY27:
60-
# Python 2.6 does not support the `errors` argument, so we cannot
61-
# control the replacement of unsafe chars in it.
62-
return s.decode(defenc)
63-
else:
64-
return s.decode(defenc, errors='replace')
57+
return s.decode(defenc, errors='replace')
6558
raise TypeError('Expected bytes or text, but got %r' % (s,))
6659

6760

0 commit comments

Comments
 (0)