From 768b9fffa58e82d6aa1f799bd5caebede9c9231b Mon Sep 17 00:00:00 2001 From: Harmon Date: Fri, 7 Feb 2020 06:20:23 -0600 Subject: Remove and replace compat.string_types --- git/config.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'git/config.py') diff --git a/git/config.py b/git/config.py index 6b45bc63..75f17368 100644 --- a/git/config.py +++ b/git/config.py @@ -16,7 +16,6 @@ import re from collections import OrderedDict from git.compat import ( - string_types, defenc, force_text, with_metaclass, @@ -302,7 +301,7 @@ class GitConfigParser(with_metaclass(MetaParserBuilder, cp.RawConfigParser, obje # END single file check file_or_files = self._file_or_files - if not isinstance(self._file_or_files, string_types): + if not isinstance(self._file_or_files, str): file_or_files = self._file_or_files.name # END get filename from handle/stream # initialize lock base - we want to write @@ -578,7 +577,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 + (IOBase, )) + is_file_lock = isinstance(fp, (str, IOBase)) if is_file_lock: self._lock._obtain_lock() if not hasattr(fp, "seek"): @@ -670,7 +669,7 @@ class GitConfigParser(with_metaclass(MetaParserBuilder, cp.RawConfigParser, obje if vl == 'true': return True - if not isinstance(valuestr, string_types): + if not isinstance(valuestr, str): raise TypeError( "Invalid value type: only int, long, float and str are allowed", valuestr) -- cgit v1.2.1