Skip to content
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

fix: protect stdout/stderr restoration in InProcessKernel._redirected_io #1122

Merged
merged 1 commit into from
Jun 8, 2023

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
Member

@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
31 of 33 checks passed
@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.

None yet

2 participants