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

Provide py:: wrapper for warnings? #601

Open
virtuald opened this issue Jan 11, 2017 · 5 comments
Open

Provide py:: wrapper for warnings? #601

virtuald opened this issue Jan 11, 2017 · 5 comments

Comments

@virtuald
Copy link
Contributor

It would be useful to be able to use that API safely available from wrapper code. It seems now that some extra effort would be needed to make it work, because sometimes it throws and sometimes it won't?

@virtuald
Copy link
Contributor Author

I guess it wouldn't be so bad, it would probably look something like...

void ::warning(category, const char * warning, stack=1) {
    if (PyErr_WarnEx(category, warning, stack) == -1) 
        throw new pybind11::error_already_set;
}

@wjakob
Copy link
Member

wjakob commented Mar 22, 2017

Do you want to turn this into a PR?

@virtuald
Copy link
Contributor Author

virtuald commented Aug 7, 2020

Sure, I can make a PR this weekend. I wonder what I needed this for.

@Skylion007
Copy link
Collaborator

@virtuald Use deprecation warnings would be nice.

@auscompgeek
Copy link
Contributor

Yeah, I think we wanted to raise DeprecationWarnings too 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants