diff options
author | Harmon <Harmon758@gmail.com> | 2020-02-07 06:20:23 -0600 |
---|---|---|
committer | Sebastian Thiel <sebastian.thiel@icloud.com> | 2020-02-08 10:55:50 +0800 |
commit | 768b9fffa58e82d6aa1f799bd5caebede9c9231b (patch) | |
tree | 0f995bb2702601f5edc3db05c85169f12e547ee8 /git/index/base.py | |
parent | 5d22d57010e064cfb9e0b6160e7bd3bb31dbfffc (diff) | |
download | gitpython-768b9fffa58e82d6aa1f799bd5caebede9c9231b.tar.gz |
Remove and replace compat.string_types
Diffstat (limited to 'git/index/base.py')
-rw-r--r-- | git/index/base.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/git/index/base.py b/git/index/base.py index 98c3b0f1..8ff0f982 100644 --- a/git/index/base.py +++ b/git/index/base.py @@ -11,7 +11,6 @@ import subprocess import tempfile from git.compat import ( - string_types, force_bytes, defenc, ) @@ -571,7 +570,7 @@ class IndexFile(LazyMixin, diff.Diffable, Serializable): items = [items] for item in items: - if isinstance(item, string_types): + if isinstance(item, str): paths.append(self._to_relative_path(item)) elif isinstance(item, (Blob, Submodule)): entries.append(BaseIndexEntry.from_blob(item)) @@ -808,7 +807,7 @@ class IndexFile(LazyMixin, diff.Diffable, Serializable): for item in items: if isinstance(item, (BaseIndexEntry, (Blob, Submodule))): paths.append(self._to_relative_path(item.path)) - elif isinstance(item, string_types): + elif isinstance(item, str): paths.append(self._to_relative_path(item)) else: raise TypeError("Invalid item type: %r" % item) @@ -1087,7 +1086,7 @@ class IndexFile(LazyMixin, diff.Diffable, Serializable): handle_stderr(proc, rval_iter) return rval_iter else: - if isinstance(paths, string_types): + if isinstance(paths, str): paths = [paths] # make sure we have our entries loaded before we start checkout_index @@ -1224,7 +1223,7 @@ class IndexFile(LazyMixin, diff.Diffable, Serializable): # index against anything but None is a reverse diff with the respective # item. Handle existing -R flags properly. Transform strings to the object # so that we can call diff on it - if isinstance(other, string_types): + if isinstance(other, str): other = self.repo.rev_parse(other) # END object conversion |