summaryrefslogtreecommitdiff
path: root/git/compat.py
diff options
context:
space:
mode:
authorVincent Driessen <me@nvie.com>2016-04-14 15:58:27 +0200
committerVincent Driessen <me@nvie.com>2016-04-14 15:58:27 +0200
commit6bdaa463f7c73d30d75d7ea954dd3c5c0c31617b (patch)
treef8092627bc7d4f605771d1fd87a729c95f7c5805 /git/compat.py
parent1875885485e7c78d34fd56b8db69d8b3f0df830c (diff)
downloadgitpython-6bdaa463f7c73d30d75d7ea954dd3c5c0c31617b.tar.gz
Drop dependency on six
Diffstat (limited to 'git/compat.py')
-rw-r--r--git/compat.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/git/compat.py b/git/compat.py
index 1630fcd5..f018ef33 100644
--- a/git/compat.py
+++ b/git/compat.py
@@ -8,7 +8,6 @@
# flake8: noqa
import sys
-import six
from gitdb.utils.compat import (
PY3,
@@ -34,6 +33,7 @@ if PY3:
return bytes([n])
def mviter(d):
return d.values()
+ range = xrange
unicode = str
else:
FileType = file
@@ -44,6 +44,7 @@ else:
byte_ord = ord
bchr = chr
unicode = unicode
+ range = xrange
def mviter(d):
return d.itervalues()
@@ -52,9 +53,9 @@ PRE_PY27 = sys.version_info < (2, 7)
def safe_decode(s):
"""Safely decodes a binary string to unicode"""
- if isinstance(s, six.text_type):
+ if isinstance(s, unicode):
return s
- elif isinstance(s, six.binary_type):
+ elif isinstance(s, bytes):
if PRE_PY27:
# Python 2.6 does not support the `errors` argument, so we cannot
# control the replacement of unsafe chars in it.