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

more robust with_package/local_package #202

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

pfuehrlich-pik
Copy link

Even if package x was already attached when calling local_package(x) x was still detached at the end of the current execution context. This is confusing, because local_* functions should ideally restore the same global state as before. with_package already had a check for that, and with this PR the same check is used for local_package. Furthermore with_package is now implemented using local_package to reduce code duplication. This is also removes the on.exit that with_package was using instead of defer.

@pfuehrlich-pik
Copy link
Author

Any comments on this? Maybe @jimhester ?

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.

None yet

1 participant