diff options
author | Marcel <marcel.beining@gmail.com> | 2019-10-13 10:25:02 +0200 |
---|---|---|
committer | Sebastian Thiel <sebastian.thiel@icloud.com> | 2019-10-15 13:27:48 +0200 |
commit | d759e17181c21379d7274db76d4168cdbb403ccf (patch) | |
tree | a36a651dd63799ab94f4869564e75d3ac0f70810 /git/index | |
parent | 1fa1ce2b7dcf7f1643bb494b71b9857cbfb60090 (diff) | |
download | gitpython-d759e17181c21379d7274db76d4168cdbb403ccf.tar.gz |
As string is iterable, changed to isinstance check
test now works
Diffstat (limited to 'git/index')
-rw-r--r-- | git/index/base.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/git/index/base.py b/git/index/base.py index 9ca663f4..378a9d79 100644 --- a/git/index/base.py +++ b/git/index/base.py @@ -569,10 +569,8 @@ class IndexFile(LazyMixin, diff.Diffable, Serializable): """ Split the items into two lists of path strings and BaseEntries. """ paths = [] entries = [] - # check if is iterable, else put in list - try: - test_item = iter(items) - except TypeError: + # if it is a string put in list + if isinstance(items, str): items = [items] for item in items: @@ -806,10 +804,8 @@ class IndexFile(LazyMixin, diff.Diffable, Serializable): """Returns a list of repo-relative paths from the given items which may be absolute or relative paths, entries or blobs""" paths = [] - # check if is iterable, else put in list - try: - test_item = iter(items) - except TypeError: + # if string put in list + if isinstance(items, str): items = [items] for item in items: |