From 2e7e82b114a5c1b3eb61f171c376e1cf85563d07 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Mon, 29 Jul 2019 08:11:21 +0800 Subject: Drop python 2 support, again (revert previous revert) This reverts commit 913d806f02cf50250d230f88b897350581f80f6b. --- git/compat.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'git/compat.py') 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 -- cgit v1.2.1