diff options
-rw-r--r-- | git/compat.py | 6 | ||||
-rw-r--r-- | git/config.py | 4 |
2 files changed, 2 insertions, 8 deletions
diff --git a/git/compat.py b/git/compat.py index 86724417..1ee4e2ee 100644 --- a/git/compat.py +++ b/git/compat.py @@ -33,9 +33,6 @@ is_darwin = (os.name == 'darwin') defenc = sys.getfilesystemencoding() if PY3: - import io - FileType = io.IOBase - def byte_ord(b): return b @@ -49,9 +46,6 @@ if PY3: unicode = str binary_type = bytes else: - FileType = file # @UndefinedVariable on PY3 - # usually, this is just ascii, which might not enough for our encoding needs - # Unless it's set specifically, we override it to be utf-8 if defenc == 'ascii': defenc = 'utf-8' byte_ord = ord diff --git a/git/config.py b/git/config.py index 762069c7..be816e0a 100644 --- a/git/config.py +++ b/git/config.py @@ -9,6 +9,7 @@ configuration files""" import abc from functools import wraps import inspect +from io import IOBase import logging import os import re @@ -16,7 +17,6 @@ from collections import OrderedDict from git.compat import ( string_types, - FileType, defenc, force_text, with_metaclass, @@ -581,7 +581,7 @@ class GitConfigParser(with_metaclass(MetaParserBuilder, cp.RawConfigParser, obje fp = self._file_or_files # we have a physical file on disk, so get a lock - is_file_lock = isinstance(fp, string_types + (FileType, )) + is_file_lock = isinstance(fp, string_types + (IOBase, )) if is_file_lock: self._lock._obtain_lock() if not hasattr(fp, "seek"): |