summaryrefslogtreecommitdiff
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
parent1875885485e7c78d34fd56b8db69d8b3f0df830c (diff)
downloadgitpython-6bdaa463f7c73d30d75d7ea954dd3c5c0c31617b.tar.gz
Drop dependency on six
-rw-r--r--git/compat.py7
-rw-r--r--git/repo/base.py2
2 files changed, 5 insertions, 4 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.
diff --git a/git/repo/base.py b/git/repo/base.py
index 9d013230..f74e0b59 100644
--- a/git/repo/base.py
+++ b/git/repo/base.py
@@ -54,12 +54,12 @@ from git.compat import (
defenc,
PY3,
safe_decode,
+ range,
)
import os
import sys
import re
-from six.moves import range
DefaultDBType = GitCmdObjectDB
if sys.version_info[:2] < (2, 5): # python 2.4 compatiblity