Closed RasmusN closed 5 years ago
Thank you for pointing this out. Would the issue be solved by using the following code for Python 2?
def _reraise(exception, traceback):
# wrapped in exec, as python 3 does not support this variant of raise
exec("raise exception, None, traceback")
Yes! That solution seems to work.
Thanks, fixed in 87767dfbe15ba15d2a8338cdfddf6afc6a25dff5.
The current traceback isn't so helpful when using Python 2. The traceback message typically looks something like this
This issue arises since glfw re-raises the exception. Python 3 solves this by using raise exception.with_traceback(traceback). Solutions for this issue are discussed here https://stackoverflow.com/questions/18188563/how-to-re-raise-an-exception-in-nested-try-except-blocks
I tried Laurent LAPORTE's solution using the six-module and it seems to be working properly. However, I'm sure you want to avoid depending on this module.
Perhaps there is some other way of solving this without using a 3rd part module?