8000 gh-101892: Fix SystemError when a callable iterator call exhausts the iterator by workingpayload · Pull Request #101896 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-101892: Fix SystemError when a callable iterator call exhausts the iterator #101896

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Mar 4, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix mismerging: move the new method
  • Loading branch information
arhadthedev committed Mar 4, 2023
commit 27e478f657643bba8388f40fa49d324bfa2b5050
12 changes: 6 additions & 6 deletions Lib/test/test_iter.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,18 @@ def __call__(self):
raise IndexError # Emergency stop
return i


def exhaust(iterator):
"""Exhaust an iterator without raising StopIteration."""
list(iterator)


class EmptyIterClass:
def __len__(self):
return 0
def __getitem__(self, i):
raise StopIteration


def exhaust(iterator):
"""Exhaust an iterator without raising StopIteration."""
list(iterator)


# Main test suite

class TestCase(unittest.TestCase):
Expand Down
0