summaryrefslogtreecommitdiff
path: root/git/compat.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2015-01-04 19:50:28 +0100
committerSebastian Thiel <byronimo@gmail.com>2015-01-04 19:50:28 +0100
commitae2ff0f9d704dc776a1934f72a339da206a9fff4 (patch)
tree53b7cb30f47c60bdf38d824f1c729191d1f1f2d9 /git/compat.py
parentf6aa8d116eb33293c0a9d6d600eb7c32832758b9 (diff)
downloadgitpython-ae2ff0f9d704dc776a1934f72a339da206a9fff4.tar.gz
Dum brute force conversion of all types.
However, StringIO really is ByteIO in most cases, and py2.7 should run but doesn't. This should be made work first.
Diffstat (limited to 'git/compat.py')
-rw-r--r--git/compat.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/git/compat.py b/git/compat.py
index 52fc599c..611005a1 100644
--- a/git/compat.py
+++ b/git/compat.py
@@ -5,15 +5,22 @@
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
"""utilities to help provide compatibility with python 3"""
+# flake8: noqa
-from gitdb.utils.compat import ( # noqa
+from gitdb.utils.compat import (
PY3,
xrange,
MAXSIZE,
izip,
)
-from gitdb.utils.encoding import ( # noqa
+from gitdb.utils.encoding import (
string_types,
text_type
)
+
+if PY3:
+ import io
+ FileType = io.IOBase
+else:
+ FileType = file