Skip to content

Conversation

@a-detiste
Copy link
Contributor

more cleanup :-)

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