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 (#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

git/objects/submodule/base.py

Lines changed: 1 addition & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy