Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lupa/tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

else:
self.fail('expected error not raised')
expected_message = 'module \'UNKNOWNöMODULEäNAME\' not found'
Expand Down Expand Up @@ -2079,7 +2079,7 @@ def mandelbrot(i, lua_func):
# plausability checks - make sure it's not all white or all black
self.assertEqual('\0'.encode('ASCII')*(image_size//8//2),
result_bytes[:image_size//8//2])
self.assertTrue('\xFF'.encode('ISO-8859-1') in result_bytes)
self.assertTrue(b'\xFF' in result_bytes)

# if we have PIL, check that it can read the image
## try:
Expand Down
Loading