Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 28afef5 commit 722473eCopy full SHA for 722473e
git/compat.py
@@ -48,20 +48,13 @@ def mviter(d):
48
def mviter(d):
49
return d.itervalues()
50
51
-PRE_PY27 = sys.version_info < (2, 7)
52
-
53
54
def safe_decode(s):
55
"""Safely decodes a binary string to unicode"""
56
if isinstance(s, unicode):
57
return s
58
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')
+ return s.decode(defenc, errors='replace')
65
raise TypeError('Expected bytes or text, but got %r' % (s,))
66
67
0 commit comments