summaryrefslogtreecommitdiff
path: root/git
diff options
context:
space:
mode:
authorSebastian Thiel <sthiel@thoughtworks.com>2019-07-29 08:11:21 +0800
committerSebastian Thiel <sthiel@thoughtworks.com>2019-08-11 14:40:42 +0800
commit2e7e82b114a5c1b3eb61f171c376e1cf85563d07 (patch)
tree6dacb948f8fd22038623bc6ecd81c1d6dd5d59d0 /git
parent0b6b90f9f1e5310a6f39b75e17a04c1133269e8f (diff)
downloadgitpython-2e7e82b114a5c1b3eb61f171c376e1cf85563d07.tar.gz
Drop python 2 support, again (revert previous revert)
This reverts commit 913d806f02cf50250d230f88b897350581f80f6b.
Diffstat (limited to 'git')
-rw-r--r--git/compat.py5
-rw-r--r--git/repo/base.py1
2 files changed, 5 insertions, 1 deletions
diff --git a/git/compat.py b/git/compat.py
index b63768f3..02dc69de 100644
--- a/git/compat.py
+++ b/git/compat.py
@@ -30,7 +30,10 @@ PY3 = sys.version_info[0] >= 3
is_win = (os.name == 'nt')
is_posix = (os.name == 'posix')
is_darwin = (os.name == 'darwin')
-defenc = sys.getdefaultencoding()
+if hasattr(sys, 'getfilesystemencoding'):
+ defenc = sys.getfilesystemencoding()
+if defenc is None:
+ defenc = sys.getdefaultencoding()
if PY3:
import io
diff --git a/git/repo/base.py b/git/repo/base.py
index af8e0c74..52eeb67b 100644
--- a/git/repo/base.py
+++ b/git/repo/base.py
@@ -4,6 +4,7 @@
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
+from builtins import str
from collections import namedtuple
import logging
import os