Skip to content

Conversation

@charles-cooper
Copy link
Contributor

contextlib.contextmanager does not always run code following the yield statement. this commit adds a finally block to ensure that stdout and stderr are properly restored even in the presence of uncaught exceptions.

`contextlib.contextmanager` does not always run code following the
`yield` statement. this commit adds a finally block to ensure that
stdout and stderr are properly restored even in the presence of uncaught
exceptions.
@charles-cooper charles-cooper changed the title fix: protect stdout/stderr restoration in InProcessKernel._redirected_io fix: protect stdout/stderr restoration in InProcessKernel._redirected_io Jun 8, 2023
@blink1073 blink1073 added the bug label Jun 8, 2023
Copy link
Contributor

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@blink1073 blink1073 merged commit 1c7f626 into ipython:main Jun 8, 2023
@charles-cooper charles-cooper deleted the fix/io-redirection branch June 8, 2023 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants