|
11 | 11 | importtempfile |
12 | 12 |
|
13 | 13 | fromgit.compatimport ( |
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 | foriteminitems: |
574 | | -ifisinstance(item,string_types): |
| 573 | +ifisinstance(item,str): |
575 | 574 | paths.append(self._to_relative_path(item)) |
576 | 575 | elifisinstance(item, (Blob,Submodule)): |
577 | 576 | entries.append(BaseIndexEntry.from_blob(item)) |
@@ -808,7 +807,7 @@ def _items_to_rela_paths(self, items): |
808 | 807 | foriteminitems: |
809 | 808 | ifisinstance(item, (BaseIndexEntry, (Blob,Submodule))): |
810 | 809 | paths.append(self._to_relative_path(item.path)) |
811 | | -elifisinstance(item,string_types): |
| 810 | +elifisinstance(item,str): |
812 | 811 | paths.append(self._to_relative_path(item)) |
813 | 812 | else: |
814 | 813 | raiseTypeError("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 | returnrval_iter |
1089 | 1088 | else: |
1090 | | -ifisinstance(paths,string_types): |
| 1089 | +ifisinstance(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 | | -ifisinstance(other,string_types): |
| 1226 | +ifisinstance(other,str): |
1228 | 1227 | other=self.repo.rev_parse(other) |
1229 | 1228 | # END object conversion |
1230 | 1229 |
|
|