|
11 | 11 | import tempfile
|
12 | 12 |
|
13 | 13 | from git.compat import (
|
14 |
| - string_types, |
15 | 14 | force_bytes,
|
16 | 15 | defenc,
|
17 | 16 | )
|
@@ -571,7 +570,7 @@ def _preprocess_add_items(self, items):
|
571 | 570 | items = [items]
|
572 | 571 |
|
573 | 572 | for item in items:
|
574 |
| - if isinstance(item, string_types): |
| 573 | + if isinstance(item, str): |
575 | 574 | paths.append(self._to_relative_path(item))
|
576 | 575 | elif isinstance(item, (Blob, Submodule)):
|
577 | 576 | entries.append(BaseIndexEntry.from_blob(item))
|
@@ -808,7 +807,7 @@ def _items_to_rela_paths(self, items):
|
808 | 807 | for item in items:
|
809 | 808 | if isinstance(item, (BaseIndexEntry, (Blob, Submodule))):
|
810 | 809 | paths.append(self._to_relative_path(item.path))
|
811 |
| - elif isinstance(item, string_types): |
| 810 | + elif isinstance(item, str): |
812 | 811 | paths.append(self._to_relative_path(item))
|
813 | 812 | else:
|
814 | 813 | raise TypeError("Invalid item type: %r" % item)
|
@@ -1087,7 +1086,7 @@ def handle_stderr(proc, iter_checked_out_files):
|
1087 | 1086 | handle_stderr(proc, rval_iter)
|
1088 | 1087 | return rval_iter
|
1089 | 1088 | else:
|
1090 |
| - if isinstance(paths, string_types): |
| 1089 | + if isinstance(paths, str): |
1091 | 1090 | paths = [paths]
|
1092 | 1091 |
|
1093 | 1092 | # make sure we have our entries loaded before we start checkout_index
|
@@ -1224,7 +1223,7 @@ def diff(self, other=diff.Diffable.Index, paths=None, create_patch=False, **kwar
|
1224 | 1223 | # index against anything but None is a reverse diff with the respective
|
1225 | 1224 | # item. Handle existing -R flags properly. Transform strings to the object
|
1226 | 1225 | # so that we can call diff on it
|
1227 |
| - if isinstance(other, string_types): |
| 1226 | + if isinstance(other, str): |
1228 | 1227 | other = self.repo.rev_parse(other)
|
1229 | 1228 | # END object conversion
|
1230 | 1229 |
|
|
0 commit comments