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

remove IS_PYTHON2 from tests too #279

Merged
merged 3 commits into from
Feb 15, 2025
Merged

remove IS_PYTHON2 from tests too #279

merged 3 commits into from
Feb 15, 2025

Conversation

a-detiste
Copy link
Contributor

more cleanup :-)

lupa/tests/test.py Outdated Show resolved Hide resolved
lupa/tests/test.py Outdated Show resolved Hide resolved
@@ -162,7 +162,7 @@ def test_eval_error_message_decoding(self):
try:
self.lua.eval('require "UNKNOWNöMODULEäNAME"')
except self.lupa.LuaError:
error = '%s'.decode('ASCII') % sys.exc_info()[1]
error = str(sys.exc_info()[1])
Copy link
Contributor Author

Choose a reason for hiding this comment

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

exc_info is already always a str

Copy link
Owner

Choose a reason for hiding this comment

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

No, it's an exception instance. But looking at it again, I noticed that we can avoid calling sys.exc_info all together just to get at the current exception that we're handling.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm happy this goes well. Some other projects want to keep their cargo-culted compat.py forever.
There's always opportunity to learn new tricks.

@scoder scoder merged commit 0d382c4 into scoder:master Feb 15, 2025
60 of 61 checks passed
@scoder
Copy link
Owner

scoder commented Feb 15, 2025

Thanks

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