Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 3 additions & 7 deletions src/core/IronPython/Runtime/Generator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,8 @@ private object @throw(object? type, object? value, object? traceback, bool final
// We create the actual exception from inside the generator so that if the exception's __init__
// throws, the traceback matches that which we get from CPython.
Debug.Assert(_sendValue == null);
_excInfo = new object?[] { type, value, traceback };

if (!MoveNextCore()) {
return LightExceptions.Throw(PythonOps.StopIteration());
}
return CurrentValue;
_excInfo = [ type, value, traceback ];
return Next();
}
} finally {
ClearActive();
Expand Down Expand Up @@ -492,7 +488,7 @@ private object NextWorker() {
// 1. return an item: _next() returns true and 'next' is set to the next item in the enumeration.
// 2. Exit normally: _next returns false.
// 3. Exit with a StopIteration exception: for-loops and other enumeration consumers will
// catch this and terminate the loop without propogating the exception.
// catch this and terminate the loop without propagating the exception.
// 4. Exit via some other unhandled exception: This will close the generator, but the exception still propagates.
// _next does not return, so ret is left assigned to false (closed), which we detect in the finally.
if (!(ret = GetNext())) {
Expand Down
33 changes: 0 additions & 33 deletions tests/suite/stdlib/test_contextlib.py

This file was deleted.

1 change: 0 additions & 1 deletion tests/suite/stdlib/test_yield_from.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def load_tests(loader, standard_tests, pattern):
if is_ironpython:
failing_tests = [
test_yield_from.TestPEP380Operation('test_broken_getattr_handling'), # TODO: figure out
test_yield_from.TestPEP380Operation('test_catching_exception_from_subgen_and_returning'), # TODO: figure out
]

skip_tests = []
Expand Down
Loading