diff options
author | Harmon <Harmon758@gmail.com> | 2020-02-07 05:56:27 -0600 |
---|---|---|
committer | Sebastian Thiel <sebastian.thiel@icloud.com> | 2020-02-08 10:55:50 +0800 |
commit | 6aa78cd3b969ede76a1a6e660962e898421d4ed8 (patch) | |
tree | 5eb2363fb7d727770da0b00c6a3fc081470cbd06 /git/diff.py | |
parent | e633cc009fe3dc8d29503b0d14532dc5e8c44cce (diff) | |
download | gitpython-6aa78cd3b969ede76a1a6e660962e898421d4ed8.tar.gz |
Remove checks for Python 2 and/or 3
Diffstat (limited to 'git/diff.py')
-rw-r--r-- | git/diff.py | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/git/diff.py b/git/diff.py index 42a68dfc..567e3e70 100644 --- a/git/diff.py +++ b/git/diff.py @@ -6,10 +6,7 @@ import re from git.cmd import handle_process_output -from git.compat import ( - defenc, - PY3 -) +from git.compat import defenc from git.util import finalize_process, hex_to_bin from .objects.blob import Blob @@ -27,10 +24,7 @@ _octal_byte_re = re.compile(b'\\\\([0-9]{3})') def _octal_repl(matchobj): value = matchobj.group(1) value = int(value, 8) - if PY3: - value = bytes(bytearray((value,))) - else: - value = chr(value) + value = bytes(bytearray((value,))) return value @@ -369,8 +363,6 @@ class Diff(object): # Python2 silliness: have to assure we convert our likely to be unicode object to a string with the # right encoding. Otherwise it tries to convert it using ascii, which may fail ungracefully res = h + msg - if not PY3: - res = res.encode(defenc) # end return res |