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

Move SystemPrepare to context manager #2484

Merged
merged 2 commits into from
Feb 29, 2024
Merged

Conversation

schaefi
Copy link
Collaborator

@schaefi schaefi commented Feb 27, 2024

Change the SystemPrepare class to context manager. All code using SystemPrepare was updated to the following with statement:

with SystemPrepare(...) as system_prepare:
    system_prepare.some_member()

This completes the refactoring from finalizers to
context managers and Fixes #2412

Change the SystemPrepare class to context manager.
All code using SystemPrepare was updated to the following
with statement:

    with SystemPrepare(...) as system_prepare:
        system_prepare.some_member()

This completes the refactoring from finalizers to
context managers and Fixes #2412
@schaefi schaefi requested a review from dcermak February 27, 2024 14:45
@schaefi schaefi self-assigned this Feb 27, 2024
Only a KiwiCommandError is an exception we want to
catch and handle, everything else is a bug and should
not be masked
@dcermak dcermak merged commit 11eebcb into main Feb 29, 2024
15 checks passed
@dcermak dcermak deleted the system_prepare_to_context branch February 29, 2024 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stop using __del__ for cleanup and switch to context managers
2 participants