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

Avoid TypeError in Transaction.__repr__ #703

Merged
merged 2 commits into from
Mar 8, 2021

Conversation

BeatButton
Copy link
Contributor

Fixes #702

@@ -234,7 +234,7 @@ def __repr__(self):
attrs = []
attrs.append('state:{}'.format(self._state.name.lower()))

attrs.append(self._isolation)
attrs.append(str(self._isolation))
Copy link
Member

Choose a reason for hiding this comment

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

I think if self._isolation is not None would be more appropriate here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, right, that is indeed more consistent with the rest of the repr.

@BeatButton BeatButton changed the title Cast Transaction._isolation to str in __repr__ Avoid TypeError in Transaction.__repr__ Feb 15, 2021
@elprans elprans merged commit d6eea8e into MagicStack:master Mar 8, 2021
@elprans elprans mentioned this pull request May 17, 2021
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.

Default isolation level None breaks Transaction.__repr__
2 participants