Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Throw std::runtime_exception instead of char*.#9289

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

anntzer
Copy link
Contributor

This should make it easier to debug exceptions falling out of the C++
code, as the C++ runtime will print the error message (thewhat() of
the exception) on its way to aborting the program.

Did a regex replace; removed thechar* handler in CALL_CPP_FULL; and
remove a bunch of extra whitespace.

For example, before application of the patch in#9074, the failing code now gives

terminate called after throwing an instance of 'std::runtime_error'  what():  Couldn't close fileFatal Python error: Aborted

Should also help with#9244.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

This should make it easier to debug exceptions falling out of the C++code, as the C++ runtime will print the error message (the `what()` ofthe exception) on its way to aborting the program.Did a regex replace; removed the `char*` handler in CALL_CPP_FULL; andremove a bunch of extra whitespace.
@tacaswell
Copy link
Member

Would prefer@mdboom or@ianthomas23 sign off on this before merging.

Copy link
Member

@ianthomas23ianthomas23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'm happy with this.

Don't understand the AppVeyor failure.

@tacaswelltacaswell added this to the2.1.1 (next bug fix release) milestoneOct 6, 2017
@tacaswell
Copy link
Member

We don't either yet, see#9176 and#9282

@tacaswelltacaswell merged commit89183ba intomatplotlib:masterOct 6, 2017
@anntzeranntzer deleted the dont-throw-cpp-strings branchOctober 6, 2017 20:34
@Kojoley
Copy link
Member

Hm.CALL_CPP_FULL is used to catch C++ exceptions and convert them to Python.std::runtime_error is not handled by it (you just simply removedchar const *e), so all these exception now will be caught bycatch (...) and raise in Python with"Unknown exception in %s" message.
Am I wrong?

@anntzer
Copy link
ContributorAuthor

Oops. New PR coming.

QuLogic added a commit that referenced this pull requestOct 6, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ianthomas23ianthomas23ianthomas23 approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
v2.1.1
Development

Successfully merging this pull request may close these issues.

4 participants
@anntzer@tacaswell@Kojoley@ianthomas23

[8]ページ先頭

©2009-2025 Movatter.jp