Skip to content

Commit c3c008c

Browse files
committed
In Submodule.iter_items, don't attach second empty iterator
This fixes the minor bug where a separate empty iterator was bound to the StopIteration exception raised as a result of returning from the generator function (gitpython-developers#1779). This change does not cause what exceptions are raised from GitPython code in any situations, nor how many items any iterators yield.
1 parent f5dc1c4 commit c3c008c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: git/objects/submodule/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1401,7 +1401,7 @@ def iter_items(
14011401
pc = repo.commit(parent_commit) # Parent commit instance
14021402
parser = cls._config_parser(repo, pc, read_only=True)
14031403
except (IOError, BadName):
1404-
return iter([])
1404+
return
14051405
# END handle empty iterator
14061406

14071407
for sms in parser.sections():

0 commit comments

Comments
 (0)