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

Fix bug when raising uncaught exception & Add exception test cases #140

Merged
merged 1 commit into from
Sep 7, 2013

Conversation

yuancheng-p
Copy link
Contributor

  • Most C++ exceptions appear in Python as a RuntimeError.
    This bug is fixed by registering additional exception translators.
  • Changed run_test for comparing the exception type raised in python
    and the type raised in pythran.

@pbrunet
Copy link
Collaborator

pbrunet commented Aug 13, 2013

Why it is not possible to handle case of environment error? what kind of error message do you have?

@yuancheng-p
Copy link
Contributor Author

If they are registered, the error will be http://pastebin.com/4fD85k9E
As you have said on IRC, to wait can be a solution for the moment.

@pbrunet
Copy link
Collaborator

pbrunet commented Aug 13, 2013

Même si tu appelles : REGISTER_EXCEPTION_TRANSLATOR sur ces fameuses exceptions?

@yuancheng-p
Copy link
Contributor Author

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)

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

@joker-eph
Copy link
Collaborator

Test failed.
Refer to this link for build results: http://jenkins.amini.fr:10000/job/Pythran/103/

#ifdef MS_WINDOWS
REGISTER_EXCEPTION_TRANSLATOR(WindowsError);
#endif

Copy link
Collaborator

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

@joker-eph
Copy link
Collaborator

Test failed.
Refer to this link for build results: http://jenkins.amini.fr:10000/job/Pythran/104/

@joker-eph
Copy link
Collaborator

Test failed.
Refer to this link for build results: http://jenkins.amini.fr:10000/job/Pythran/105/

@joker-eph
Copy link
Collaborator

This PR is messy somewhere, it makes my build bot stuck forever.

@joker-eph
Copy link
Collaborator

Test failed.
Refer to this link for build results: http://jenkins.amini.fr:10000/job/Pythran/106/

@joker-eph
Copy link
Collaborator

Test failed.
Refer to this link for build results: http://jenkins.amini.fr:10000/job/Pythran/115/

@joker-eph
Copy link
Collaborator

Test failed.
Refer to this link for build results: http://jenkins.amini.fr:10000/job/Pythran/116/

* 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.
@serge-sans-paille
Copy link
Owner

The commit is now OK to me, @pbrunet , any thought ?

@joker-eph
Copy link
Collaborator

jenkins test this please

@serge-sans-paille serge-sans-paille mentioned this pull request Sep 5, 2013
@joker-eph
Copy link
Collaborator

Test failed.
Refer to this link for build results: http://jenkins.amini.fr:10000/job/Pythran/121/

@joker-eph
Copy link
Collaborator

jenkins test this please

@joker-eph
Copy link
Collaborator

Test failed.
Refer to this link for build results: http://jenkins.amini.fr:10000/job/Pythran/124/

@joker-eph
Copy link
Collaborator

Looks good to me!

pbrunet added a commit that referenced this pull request Sep 7, 2013
Fix bug when raising uncaught exception & Add exception test cases
@pbrunet pbrunet merged commit a36a202 into serge-sans-paille:master Sep 7, 2013
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.

4 participants