summaryrefslogtreecommitdiff
path: root/git/compat.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2015-01-05 16:44:54 +0100
committerSebastian Thiel <byronimo@gmail.com>2015-01-05 16:44:54 +0100
commit8a308613467a1510f8dac514624abae4e10c0779 (patch)
tree6c703cb00875ca77972b6250db8b63800a051502 /git/compat.py
parent3d0556a31916a709e9da3eafb92fc6b8bf69896c (diff)
downloadgitpython-8a308613467a1510f8dac514624abae4e10c0779.tar.gz
Fixes test_blob and improved commit writing/reading
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 4a892ad2..f11d1423 100644
--- a/git/compat.py
+++ b/git/compat.py
@@ -27,12 +27,15 @@ defenc = sys.getdefaultencoding()
if PY3:
import io
FileType = io.IOBase
+ def byte_ord(b):
+ return b
else:
FileType = file
# usually, this is just ascii, which might not enough for our encoding needs
# Unless it's set specifically, we override it to be utf-8
if defenc == 'ascii':
defenc = 'utf-8'
+ byte_ord = ord
def with_metaclass(meta, *bases):
@@ -54,4 +57,3 @@ def with_metaclass(meta, *bases):
# end metaclass
return metaclass(meta.__name__ + 'Helper', None, {})
# end handle py2
-