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

[SceneLoader] Add a special error message handler for DeprecationWarning #384

Conversation

damienmarchal
Copy link
Contributor

Currently DeprecationWarning exception risen by python code are reported as msg_error()
which is misleading. The PR detect it so it is reported with msg_deprecated()

This is the source of this:
SofaDefrost/STLIB#117

…ionWarning

Otherwise deprecation messages appears as error which is misleading for users.
Copy link
Contributor

@alxbilger alxbilger left a comment

Choose a reason for hiding this comment

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

Do we move on with this PR?

Plugin/src/SofaPython3/SceneLoaderPY3.cpp Outdated Show resolved Hide resolved
Co-authored-by: Alex Bilger <alxbilger@users.noreply.github.com>
@damienmarchal
Copy link
Contributor Author

Yes :)

@hugtalbot hugtalbot changed the title [SofaPython3/Plugin] Add a special error message handler for DeprecationWarning. [SceneLoader] Add a special error message handler for DeprecationWarning. Mar 6, 2024
@hugtalbot hugtalbot changed the title [SceneLoader] Add a special error message handler for DeprecationWarning. [SceneLoader] Add a special error message handler for DeprecationWarning Mar 6, 2024
@hugtalbot
Copy link
Contributor

It would be nice, any update @damienmarchal ?

if( py::isinstance(e.type(), py::eval("type(DeprecationWarning)")) )
{
msg_deprecated() << ss.str();
}else
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
}else
}
else

{
msg_error() << ss.str();
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

@fredroy fredroy merged commit 32e66f4 into sofa-framework:master Apr 3, 2024
0 of 4 checks passed
bakpaul pushed a commit to bakpaul/SofaPython3 that referenced this pull request Jun 21, 2024
…ing (sofa-framework#384)

* [SofaPython3/Plugin] Add a special error message handler for DeprecationWarning

Otherwise deprecation messages appears as error which is misleading for users.

* Update Plugin/src/SofaPython3/SceneLoaderPY3.cpp

Co-authored-by: Alex Bilger <alxbilger@users.noreply.github.com>

---------

Co-authored-by: Alex Bilger <alxbilger@users.noreply.github.com>
damienmarchal added a commit that referenced this pull request Sep 13, 2024
…ing (#384)

* [SofaPython3/Plugin] Add a special error message handler for DeprecationWarning

Otherwise deprecation messages appears as error which is misleading for users.

* Update Plugin/src/SofaPython3/SceneLoaderPY3.cpp

Co-authored-by: Alex Bilger <alxbilger@users.noreply.github.com>

---------

Co-authored-by: Alex Bilger <alxbilger@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pr: status ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants