| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8fc6563 commit c49ba43
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1160,7 +1160,7 @@ def iter_items(cls, repo, parent_commit='HEAD'): | |||
| 1160 | 1160 | try: | |
| 1161 | 1161 | parser = cls._config_parser(repo, pc, read_only=True) | |
| 1162 | 1162 | except IOError: | |
| 1163 | - raise StopIteration | ||
| 1163 | + return | ||
| 1164 | 1164 | # END handle empty iterator | |
| 1165 | 1165 | ||
| 1166 | 1166 | rt = pc.tree # root tree | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -714,7 +714,10 @@ def blame_incremental(self, rev, file, **kwargs): | |||
| 714 | 714 | ||
| 715 | 715 | stream = (line for line in data.split(b'\n') if line) | |
| 716 | 716 | while True: | |
| 717 | - line = next(stream) # when exhausted, causes a StopIteration, terminating this function | ||
| 717 | + try: | ||
| 718 | + line = next(stream) # when exhausted, causes a StopIteration, terminating this function | ||
| 719 | + except StopIteration: | ||
| 720 | + return | ||
| 718 | 721 | hexsha, orig_lineno, lineno, num_lines = line.split() | |
| 719 | 722 | lineno = int(lineno) | |
| 720 | 723 | num_lines = int(num_lines) | |
@@ -724,7 +727,10 @@ def blame_incremental(self, rev, file, **kwargs): | |||
| 724 | 727 | # for this commit | |
| 725 | 728 | props = {} | |
| 726 | 729 | while True: | |
| 727 | - line = next(stream) | ||
| 730 | + try: | ||
| 731 | + line = next(stream) | ||
| 732 | + except StopIteration: | ||
| 733 | + return | ||
| 728 | 734 | if line == b'boundary': | |
| 729 | 735 | # "boundary" indicates a root commit and occurs | |
| 730 | 736 | # instead of the "previous" tag | |
@@ -749,7 +755,10 @@ def blame_incremental(self, rev, file, **kwargs): | |||
| 749 | 755 | # Discard all lines until we find "filename" which is | |
| 750 | 756 | # guaranteed to be the last line | |
| 751 | 757 | while True: | |
| 752 | - line = next(stream) # will fail if we reach the EOF unexpectedly | ||
| 758 | + try: | ||
| 759 | + line = next(stream) # will fail if we reach the EOF unexpectedly | ||
| 760 | + except StopIteration: | ||
| 761 | + return | ||
| 753 | 762 | tag, value = line.split(b' ', 1) | |
| 754 | 763 | if tag == b'filename': | |
| 755 | 764 | orig_filename = value | |
| Back | FazBrowse Home | New Git URL |
0 commit comments