Skip to content

Add support for diffing against root commit #408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Apr 19, 2016
Prev Previous commit
Next Next commit
Remove Python 2.6 hack
Since support was dropped.
  • Loading branch information
nvie committed Apr 19, 2016
commit 722473e86e64405ac5eb9cb43133f8953d6c65d0
9 changes: 1 addition & 8 deletions git/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,13 @@ def mviter(d):
def mviter(d):
return d.itervalues()

PRE_PY27 = sys.version_info < (2, 7)


def safe_decode(s):
"""Safely decodes a binary string to unicode"""
if isinstance(s, unicode):
return s
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.
return s.decode(defenc)
else:
return s.decode(defenc, errors='replace')
return s.decode(defenc, errors='replace')
raise TypeError('Expected bytes or text, but got %r' % (s,))


Expand Down