summaryrefslogtreecommitdiff
path: root/git/compat.py
diff options
context:
space:
mode:
authorBarry Scott <barry@barrys-emacs.org>2016-07-12 18:27:03 +0100
committerBarry Scott <barry@barrys-emacs.org>2016-07-12 18:27:03 +0100
commitb4b5ecc217154405ac0f6221af99a4ab18d067f6 (patch)
tree42ec5a4a19a52158c6aa6a20afabd75450f4fbe2 /git/compat.py
parenta7f403b1e82d4ada20d0e747032c7382e2a6bf63 (diff)
parent4896fa2ccbd84553392e2a74af450d807e197783 (diff)
downloadgitpython-b4b5ecc217154405ac0f6221af99a4ab18d067f6.tar.gz
Merge branch 'master' of https://github.com/gitpython-developers/GitPython
Diffstat (limited to 'git/compat.py')
-rw-r--r--git/compat.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/git/compat.py b/git/compat.py
index 76509ba6..b3572474 100644
--- a/git/compat.py
+++ b/git/compat.py
@@ -35,6 +35,7 @@ if PY3:
return d.values()
range = xrange
unicode = str
+ binary_type = bytes
else:
FileType = file
# usually, this is just ascii, which might not enough for our encoding needs
@@ -44,6 +45,7 @@ else:
byte_ord = ord
bchr = chr
unicode = unicode
+ binary_type = str
range = xrange
def mviter(d):
return d.itervalues()
@@ -54,7 +56,7 @@ def safe_decode(s):
if isinstance(s, unicode):
return s
elif isinstance(s, bytes):
- return s.decode(defenc, errors='replace')
+ return s.decode(defenc, 'replace')
raise TypeError('Expected bytes or text, but got %r' % (s,))