-
Notifications
You must be signed in to change notification settings - Fork 193
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
Fix bug when raising uncaught exception & Add exception test cases #140
Conversation
Why it is not possible to handle case of environment error? what kind of error message do you have? |
If they are registered, the error will be http://pastebin.com/4fD85k9E |
Même si tu appelles : REGISTER_EXCEPTION_TRANSLATOR sur ces fameuses exceptions? |
Nope, i have tried to add REGISTER_EXCEPTION_TRANSLATOR on the IOException, but the result is not as expected. It is always 'Exception'. |
@@ -133,10 +134,17 @@ def run_test(self, code, *params, **interface): | |||
|
|||
# Test Results, assert if mismatch | |||
self.compare_pythonpythran_results(python_ref, pythran_res) | |||
except BaseException as e: | |||
pythran_exception_type = type(e) | |||
finally: | |||
# Clean temporary DLL | |||
os.remove(cxx_compiled) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a comment there to explain what you are trying to do there
Test failed. |
#ifdef MS_WINDOWS | ||
REGISTER_EXCEPTION_TRANSLATOR(WindowsError); | ||
#endif | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you add these expression here, you should also declare them in pythran.h and in exception.h I think
Test failed. |
Test failed. |
This PR is messy somewhere, it makes my build bot stuck forever. |
Test failed. |
Test failed. |
Test failed. |
* Most C++ exceptions appear in Python as a RuntimeError. This bug is fixed by registering additional exception translators. * However, there are 2 Exceptions can not be registered on Linux: WindowsError, VMSError * Changed run_test for comparing the exception type raised in python and the type raised in pythran.
The commit is now OK to me, @pbrunet , any thought ? |
jenkins test this please |
Test failed. |
jenkins test this please |
Test failed. |
Looks good to me! |
Fix bug when raising uncaught exception & Add exception test cases
This bug is fixed by registering additional exception translators.
and the type raised in pythran.