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

Add try...finally to prefixed method #79

Merged
merged 3 commits into from
Jun 1, 2019
Merged

Conversation

rcuza
Copy link
Contributor

@rcuza rcuza commented May 23, 2019

This change is a proposed solution to issue #78.

It adds a test that fails on the code in version 4.1.3 and passes on the code in this change.

It is worth noting that refactoring Env.prefixed using the contextlib library might make be a better way to go, but I opted for the simplest fix.

rcuza added 3 commits May 23, 2019 16:01
This test runs a nested prefix then raises an exception, then runs the
nested prefix again. It will not pass if the code does not clear
`self._prefix` after the first exception.
@sloria
Copy link
Owner

sloria commented May 28, 2019

Thanks for this! I'll try to give this a look over the weekend.

@sloria sloria merged commit 95ab295 into sloria:master Jun 1, 2019
@rcuza rcuza deleted the prefix-raise branch June 2, 2019 00:30
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.

2 participants